Commit 27778b6d authored by Jakob Borg's avatar Jakob Borg

Align cleaning routine in time

parent c0fde66c
......@@ -328,7 +328,7 @@ nextAddr:
func clean(statsLog io.Writer, db *leveldb.DB) {
for {
now := time.Now()
now := next(cacheLimitSeconds)
nowSecs := now.Unix()
var kept, deleted int64
......@@ -363,7 +363,5 @@ func clean(statsLog io.Writer, db *leveldb.DB) {
iter.Release()
fmt.Fprintf(statsLog, "%d Kept:%d Deleted:%d Took:%0.04fs\n", nowSecs, kept, deleted, time.Since(now).Seconds())
time.Sleep(cacheLimitSeconds * time.Second / 2)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment