diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-18 18:30:52 +0000 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-18 19:34:47 +0100 |
commit | d223c816323f62f7e147a44823796d6bf5fc25f3 (patch) | |
tree | c9aee44fb0ecb91366330f85035703345e5b784e /cmd_collect.go | |
parent | 3715c5d8d2c36811732715257be8e7ffd0770d47 (diff) |
Print stats on shutdown
Diffstat (limited to 'cmd_collect.go')
-rw-r--r-- | cmd_collect.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cmd_collect.go b/cmd_collect.go index b33ceca..4d93271 100644 --- a/cmd_collect.go +++ b/cmd_collect.go @@ -45,12 +45,10 @@ func collect(opts options) error { // properly despite the parent context (including getRanges) // being done. The below is an ugly hack to avoid hanging. // - wait := time.Second * 5 // TODO: 15s - logger.Printf("INFO: about to exit, please wait %v...\n", wait) - select { - case <-time.After(wait): - os.Exit(0) - } + time.Sleep(time.Second) + logger.Printf("INFO: about to exit, please wait...") + time.Sleep(10 * time.Second) + os.Exit(1) }() metricsCh := make(chan metrics) |