aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index 5972132..a372fa1 100644
--- a/main.go
+++ b/main.go
@@ -109,6 +109,10 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question
req, err := http.NewRequestWithContext(cctx, http.MethodGet, "https://"+question.Domain, nil)
if err != nil {
answer.ReqErr = err
+ if cctx.Err() != nil {
+ answer.CtxErr = true
+ }
+
answerCh <- answer
return
}
@@ -116,6 +120,10 @@ func work(ctx context.Context, cli *http.Client, timeout time.Duration, question
rsp, err := cli.Do(req)
if err != nil {
answer.DoErr = err
+ if cctx.Err() != nil {
+ answer.CtxErr = true
+ }
+
answerCh <- answer
return
}