-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: panic to write in close channel #42
fix: panic to write in close channel #42
Conversation
pkg/crawler/crawler.go
Outdated
@@ -58,8 +57,12 @@ func NewCrawler(opt Option) Crawler { | |||
} | |||
} | |||
client.ErrorHandler = func(resp *http.Response, err error, numTries int) (*http.Response, error) { | |||
logger := slog.With(slog.String("url", resp.Request.URL.String()), slog.Int("status_code", resp.StatusCode), | |||
slog.Int("num_tries", numTries)) | |||
logger := &slog.Logger{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we create a new logger, the default setting is not respected.
trivy-java-db/cmd/trivy-java-db/main.go
Line 65 in 577c6a3
slog.SetLogLoggerLevel(slog.LevelInfo) // TODO: add --debug |
logger := &slog.Logger{} | |
logger := slog.Default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! Updated in 111f5bb
Description
Changes:
select
instead ofonce
forerrCh
(see fix(crawler):Visit
function should write error inerrCh
once #36 (comment))default
inselect
for write intourlCh
(see fix(crawler):Visit
function should write error inerrCh
once #36 (comment)).