Skip to content

Commit 8dfaad6

Browse files
committed
Exclude context cancellation from error stats
1 parent 23fc371 commit 8dfaad6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

candidates.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ func (p *Producer) ProduceWordList(ctx context.Context, names []string, list str
4444
scanner := bufio.NewScanner(file)
4545

4646
for scanner.Scan() {
47-
if ctx.Err() != nil {
48-
return ctx.Err()
49-
}
5047
line := scanner.Text()
5148
for _, n := range names {
5249
if !p.Produce(ctx, n, line) {

resolver.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ func (s *DNSResolver) IsBucket(ctx context.Context, name string) bool {
116116
records, err := s.resolveName(ctx, fmt.Sprintf("%s.%s", name, s3GlobalSuffix))
117117

118118
if err != nil {
119+
if ctx.Err() != nil {
120+
return false
121+
}
119122
atomic.AddUint64(&s.errors, 1)
120123
s.classifyError(err)
121124
return false

0 commit comments

Comments
 (0)