]> Sergey Matveev's repositories - btrtrc.git/blobdiff - cmd/btrtrc/status.go
Simpler cancellation with global variables
[btrtrc.git] / cmd / btrtrc / status.go
index 3d937efabd445b8f250f09ee64d53f6c91feb71d..8cb0cbc479146caea5ba1421980498fb9f2de329 100644 (file)
@@ -8,13 +8,13 @@ import (
        "github.com/dustin/go-humanize"
 )
 
-func overallStatus(c *torrent.Client, cancel chan struct{}) {
+func overallStatus(c *torrent.Client) {
        tick := time.Tick(time.Second)
        var prev torrent.ConnStats
        for {
                select {
-               case <-cancel:
-                       close(cancel)
+               case <-Cancel:
+                       Jobs.Done()
                        return
                case <-tick:
                }