This commit is contained in:
ykomissarov committed 2020-01-09 18:48:02 +03:00
1 parent b9dc101141
commit 7dd989bac2
1 file changed
+7 -4
+7 -4
View File
@@ -79,11 +79,14 @@ func (w *accountingWorker) init(accountingSetting conf.Accounting) {
newAccountingStorage[s.ApplicationId] = accounting
newRequestsStoringStorage[s.ApplicationId] = s.EnableStoring
}
w.requestsStoring = newRequestsStoringStorage
w.accountingStorage = newAccountingStorage
InitStoringTask(accountingSetting.Storing)
InitSnapshotTask(accountingSetting.SnapshotTimeout)
} else {
w.requestsStoring = newRequestsStoringStorage
w.accountingStorage = newAccountingStorage
}
w.requestsStoring = newRequestsStoringStorage
w.accountingStorage = newAccountingStorage
}
func (w *accountingWorker) takeSnapshot() []entity.Snapshot {
@@ -114,8 +117,8 @@ func (w *accountingWorker) recoveryAccounting(appId int32, limitStates map[strin
log.Warn(log_code.ErrorSnapshotAccounting, err)
}
if cash, ok := w.accountingStorage[appId]; ok {
cashLimitState, cashVersion := cash.Snapshot()
if cache, ok := w.accountingStorage[appId]; ok {
cashLimitState, cashVersion := cache.Snapshot()
if dbSnapshot == nil || dbSnapshot.Version < cashVersion {
version = cashVersion