bcacheup: slow down rate of output

This commit is contained in:
Luke Granger-Brown 2022-10-09 18:10:46 +01:00
parent 9d16934db3
commit 955b899bca

View file

@ -32,6 +32,7 @@ import (
var ( var (
blobURLFlag = flag.String("cache_url", "", "Cache URL") blobURLFlag = flag.String("cache_url", "", "Cache URL")
storeDBFlag = flag.String("nix_store_db", nixstore.DefaultStoreDB, "Path to the nix store database") storeDBFlag = flag.String("nix_store_db", nixstore.DefaultStoreDB, "Path to the nix store database")
stateSummaryIntervalFlag = flag.Interval("state_summary_interval", 10*time.Second, "Time between state summary outputs.")
) )
var ( var (
@ -433,7 +434,7 @@ func main() {
} }
go func() { go func() {
t := time.NewTicker(1 * time.Second) t := time.NewTicker(*stateSummaryIntervalFlag)
defer t.Stop() defer t.Stop()
for { for {
select { select {