diff options
-rw-r--r-- | main.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) } } }() |