swarm/storage/localstore: remove writeGCSizeDelay and use literal

This commit is contained in:
Janos Guljas 2019-01-08 15:46:10 +01:00
parent c1882818ab
commit c5e4c61385

View file

@ -148,8 +148,6 @@ func (db *DB) triggerGarbageCollection() {
} }
} }
var writeGCSizeDelay = 10 * time.Second
// writeGCSizeWorker writes gcSize on trigger event // writeGCSizeWorker writes gcSize on trigger event
// and waits writeGCSizeDelay after each write. // and waits writeGCSizeDelay after each write.
// It implements a linear backoff with delay of // It implements a linear backoff with delay of
@ -166,7 +164,7 @@ func (db *DB) writeGCSizeWorker() {
// Wait some time before writing gc size in the next // Wait some time before writing gc size in the next
// iteration. This prevents frequent I/O operations. // iteration. This prevents frequent I/O operations.
select { select {
case <-time.After(writeGCSizeDelay): case <-time.After(10 * time.Second):
case <-db.close: case <-db.close:
return return
} }