From 11e13ac8c1d61f3e3e0057beaa0627a174dacd81 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 3 May 2020 18:42:37 +1000 Subject: [PATCH] cmd/torrent: Output stats on termination, not just completion --- cmd/torrent/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 221f6a01..adc4f869 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -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 }