mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/storage/localstore: remove writeGCSizeDelay and use literal
This commit is contained in:
parent
c1882818ab
commit
c5e4c61385
1 changed files with 1 additions and 3 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue