fix concurrent read

This commit is contained in:
ykomissarov committed 2020-01-09 18:09:50 +03:00
1 parent b0cac278d2
commit 41357efef0
1 file changed
+4 -2
+4 -2
View File
@@ -90,8 +90,10 @@ func (w *accountingWorker) init(accountingSetting conf.Accounting) {
}
func (w *accountingWorker) takeSnapshot() []entity.Snapshot {
response := make([]entity.Snapshot, 0, len(w.accountingStorage))
for appId, account := range w.accountingStorage {
lastStorage := w.accountingStorage
response := make([]entity.Snapshot, 0, len(lastStorage))
for appId, account := range lastStorage {
limitState, version := account.Snapshot()