mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Fix return at LRUStore, SMGeneric to properly check EXISTS error
This commit is contained in:
@@ -176,6 +176,7 @@ func (cs lrustore) Put(key string, value interface{}) {
|
||||
mp, err = lru.New(10000)
|
||||
if err != nil {
|
||||
utils.Logger.Debug(fmt.Sprintf("<cache>: error at init: %v", err))
|
||||
return
|
||||
}
|
||||
cs.store[prefix] = mp
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@ func (self *SMGeneric) ChargeEvent(gev SMGenericEvent, clnt *rpc2.Client) (maxDu
|
||||
OriginID: gev.GetUUID(),
|
||||
CostDetails: cc,
|
||||
}
|
||||
if err := self.cdrsrv.Call("CdrsV1.StoreSMCost", engine.AttrCDRSStoreSMCost{Cost: smCost, CheckDuplicate: true}, &reply); err != nil && err.Error() != utils.ErrExists.Error() {
|
||||
if err := self.cdrsrv.Call("CdrsV1.StoreSMCost", engine.AttrCDRSStoreSMCost{Cost: smCost, CheckDuplicate: true}, &reply); err != nil && !strings.HasSuffix(err.Error(), utils.ErrExists.Error()) {
|
||||
withErrors = true
|
||||
utils.Logger.Err(fmt.Sprintf("<SMGeneric> Could not save CC: %+v, RunID: %s error: %s", cc, sR.DerivedCharger.RunID, err.Error()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user