From 906527914c2847f2fda763a1ed231cd6e021b1ed Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sun, 26 Mar 2023 12:09:56 +0200 Subject: Wait timeout + 1s before exit --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index b726dd1..e4d2027 100644 --- a/main.go +++ b/main.go @@ -202,7 +202,7 @@ func workAggregator(ctx context.Context, opts options.Options, answerCh chan qna select { case a := <-answerCh: handleAnswer(a) - case <-time.After(opts.Timeout): + case <-time.After(opts.Timeout + time.Second): return } } @@ -260,7 +260,7 @@ func workGenerator(ctx context.Context, opts options.Options, fp *os.File, quest select { case <-ctx.Done(): - case <-time.After(opts.Timeout): + case <-time.After(opts.Timeout + time.Second): } return nextLine, true } -- cgit v1.2.3