Skip to content

Commit

Permalink
reword and fix error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-decker committed Jun 13, 2022
1 parent e123e9f commit 2178f1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY . .
RUN CGO_ENABLED=0 go build -a -o trufflehog main.go

FROM alpine:3.15
RUN apk add --no-cache git
RUN apk add --no-cache git; mkdir /tmp
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /build/trufflehog /usr/bin/trufflehog
ENTRYPOINT ["/usr/bin/trufflehog"]
1 change: 1 addition & 0 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM alpine:3.15

RUN apk add --no-cache git
WORKDIR /usr/bin/
RUN mkdir /tmp
COPY trufflehog .

ENTRYPOINT ["/usr/bin/trufflehog"]
6 changes: 3 additions & 3 deletions pkg/sources/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan
errorCount.Store(prefix, nErr)
//too many consective errors on this page
if nErr.(int) > 3 {
s.log.Warnf("Too many consecutive errors. Blacklisting %s", prefix)
s.log.Warnf("Too many consecutive errors. Excluding %s", prefix)
}
log.Debugf("Error Counts: %s:%s", prefix, nErr)
log.Debugf("Error Counts: %s:%d", prefix, nErr)
return
}
body, err := ioutil.ReadAll(res.Body)
Expand All @@ -269,7 +269,7 @@ func (s *Source) pageChunker(ctx context.Context, client *s3.S3, chunksChan chan
errorCount.Store(prefix, nErr)

if nErr.(int) > 3 {
s.log.Warnf("Too many consecutive errors. Blacklisting %s", prefix)
s.log.Warnf("Too many consecutive errors. Excluding %s", prefix)
}
return
}
Expand Down

0 comments on commit 2178f1f

Please sign in to comment.