File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ func (h *MemoryAccountWithDataUpdateHandler) backupWorker(ctx context.Context) e
108
108
for {
109
109
select {
110
110
case <- time .After (h .backupWorkerInterval ):
111
- var addresses []string
111
+ addresses := []string { "F9RMtR2mjk7aRiLLjYGajvAeyPqn4BNDPy49amgCmyZh" , "Cmd2UP1qDMMUvdLVN1Q2TxsqcdE2otneZHWbTsrq6cF7" , "9tR1Q8GL5dUhNBMN1dENsiVVNCtvcUUhiFV8YtNPc2gg" }
112
112
for vm := range h .observableVmAccounts {
113
113
log := log .WithField ("vm" , vm )
114
114
@@ -348,7 +348,7 @@ func (h *MemoryAccountWithDataUpdateHandler) onStateObserved(ctx context.Context
348
348
// Update the DB with the delta changes to the memory account state
349
349
var wg sync.WaitGroup
350
350
var cachedMemoryAccountStateUpdateMu sync.Mutex
351
- for _ , dbUpdate := range dbUpdates {
351
+ for i , dbUpdate := range dbUpdates {
352
352
wg .Add (1 )
353
353
354
354
go func (dbUpdate * cachedVirtualAccount ) {
@@ -384,6 +384,10 @@ func (h *MemoryAccountWithDataUpdateHandler) onStateObserved(ctx context.Context
384
384
log .WithError (err ).Warn ("failure updating db record" )
385
385
}
386
386
}(dbUpdate )
387
+
388
+ if i % 250 == 0 {
389
+ time .Sleep (time .Second / 4 )
390
+ }
387
391
}
388
392
wg .Wait ()
389
393
You can’t perform that action at this time.
0 commit comments