aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 726da75..88260bf 100644
--- a/main.go
+++ b/main.go
@@ -44,7 +44,8 @@ func main() {
var wg sync.WaitGroup
defer wg.Wait()
- ctx, cancel := context.WithCancel(context.Background())
+ bg := context.Background()
+ ctx, cancel := context.WithCancel(bg)
defer cancel()
start := time.Now().Round(time.Second)
@@ -70,7 +71,7 @@ func main() {
case <-ctx.Done():
return
case question := <-questionCh:
- work(ctx, cli, opts.Timeout, question, answerCh)
+ work(bg, cli, opts.Timeout, question, answerCh)
}
}
}()