Compile the EventCost for sRun before storing it

This commit is contained in:
TeoV
2020-12-14 17:25:11 +02:00
committed by Dan Christian Bogos
parent 9152bb452c
commit bba4ab873d
2 changed files with 27 additions and 0 deletions

View File

@@ -1551,6 +1551,9 @@ func (sS *SessionS) endSession(s *Session, tUsage, lastUsage *time.Duration,
utils.SessionS, s.CGRID, sRunIdx, err.Error()))
}
}
// compute the event cost before saving the SessionCost
// add here to be applied for messages also
sr.EventCost.Compute()
if sS.cgrCfg.SessionSCfg().StoreSCosts {
if err := sS.storeSCost(s, sRunIdx); err != nil {
utils.Logger.Warning(