Skip to content
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

Merged
merged 7 commits into from
Sep 27, 2024

Conversation

DmitriyLewen
Copy link
Collaborator

Description

Changes:

@DmitriyLewen DmitriyLewen self-assigned this Sep 27, 2024
@@ -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{}
Copy link
Collaborator

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.

slog.SetLogLoggerLevel(slog.LevelInfo) // TODO: add --debug

Suggested change
logger := &slog.Logger{}
logger := slog.Default()

Copy link
Collaborator Author

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

@knqyf263 knqyf263 merged commit c46eaa1 into aquasecurity:main Sep 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants