Mongo counter private

This commit is contained in:
alin104n
2017-03-20 18:49:44 +02:00
parent a4148c1476
commit ce2dfabf03
2 changed files with 3 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ func NewMongoStorage(host, port, db, user, pass, storageType string, cdrsIndexes
return nil, err
}
}
ms.Counter = utils.NewCounterGen(1000)
ms.cnter = utils.NewCounterGen(1000)
return
}
@@ -124,7 +124,7 @@ type MongoStorage struct {
cacheCfg *config.CacheConfig
loadHistorySize int
cdrsIndexes []string
Counter *utils.CounterGen
cnter *utils.CounterGen
}
func (ms *MongoStorage) conn(col string) (*mgo.Session, *mgo.Collection) {

View File

@@ -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.Counter.Gen()
cdr.OrderID = time.Now().UnixNano() + ms.cnter.Gen()
}
session, col := ms.conn(utils.TBL_CDRS)
defer session.Close()