mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
@@ -24,6 +24,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/cache"
|
||||
"github.com/cgrates/cgrates/config"
|
||||
@@ -112,7 +113,7 @@ func NewMongoStorage(host, port, db, user, pass, storageType string, cdrsIndexes
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
ms.cnter = utils.NewCounterGen(1000)
|
||||
ms.cnter = utils.NewCounterGen(time.Now().UnixNano(), 0)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -883,7 +883,7 @@ func (ms *MongoStorage) GetSMCosts(cgrid, runid, originHost, originIDPrefix stri
|
||||
|
||||
func (ms *MongoStorage) SetCDR(cdr *CDR, allowUpdate bool) (err error) {
|
||||
if cdr.OrderID == 0 {
|
||||
cdr.OrderID = time.Now().UnixNano() + ms.cnter.Gen()
|
||||
cdr.OrderID = ms.cnter.Gen()
|
||||
}
|
||||
session, col := ms.conn(utils.TBL_CDRS)
|
||||
defer session.Close()
|
||||
|
||||
Reference in New Issue
Block a user