]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrent: Output stats on termination, not just completion
authorMatt Joiner <anacrolix@gmail.com>
Sun, 3 May 2020 08:42:37 +0000 (18:42 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 3 May 2020 08:42:37 +0000 (18:42 +1000)
cmd/torrent/main.go

index 221f6a0129d21275bbdc20c875a695d09465f84f..adc4f869bcf19bfda36d330139699ec228e722ef 100644 (file)
@@ -270,6 +270,7 @@ func downloadErr(args []string, parent *tagflag.Parser) error {
                client.WriteStatus(w)
        })
        addTorrents(client)
+       defer outputStats(client)
        if client.WaitAll() {
                log.Print("downloaded ALL the torrents")
        } else {
@@ -279,7 +280,6 @@ func downloadErr(args []string, parent *tagflag.Parser) error {
                outputStats(client)
                <-stop.C()
        }
-       outputStats(client)
        return nil
 }