Should reset to false, not true when done

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-08-21 14:57:17 -07:00
parent 10f73e888e
commit 0a86bf4a9a

View File

@@ -1818,7 +1818,7 @@ func (jsa *jsAccount) checkAndSyncUsage(tierName string, storeType StorageType)
if !jsa.sync.CompareAndSwap(false, true) {
return
}
defer jsa.sync.Store(true)
defer jsa.sync.Store(false)
// Hold the account read lock and the usage lock while we calculate.
// We scope by tier and storage type, but if R3 File has 200 streams etc. could