Skip to content

Commit

Permalink
Use ticker with reset instead of timer
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Dec 9, 2023
1 parent d01d79e commit 0f2c8f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion signer/cosigner_nonce_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (cnc *CosignerNonceCache) Start(ctx context.Context) {
cnc.lastReconcileNonces.Store(uint64(cnc.cache.Size()))
cnc.lastReconcileTime = time.Now()

ticker := time.NewTicker(cnc.getNoncesInterval)
ticker := time.NewTimer(cnc.getNoncesInterval)
for {
select {
case <-ctx.Done():
Expand All @@ -319,6 +319,7 @@ func (cnc *CosignerNonceCache) Start(ctx context.Context) {
}
}
cnc.reconcile(ctx)
ticker.Reset(cnc.getNoncesInterval)
}
}

Expand Down

0 comments on commit 0f2c8f4

Please sign in to comment.