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

Do not create additional goroutine for cleanup #395

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Conversation

gammazero
Copy link
Collaborator

Clenaup can be done in the worker goroutine after the worker finishes running.

Also, avoid creating a new timer in each iteration of the worker run loop. Reuse the same timer instead.

Clenaup can be done in the worker goroutine after the worker finishes running.

Also, avoid creating a new timer in each iteration of the worker run loop. Reuse the same timer instead.
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (f53abbf) 73.78% compared to head (5360101) 73.82%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #395      +/-   ##
==========================================
+ Coverage   73.78%   73.82%   +0.03%     
==========================================
  Files         147      147              
  Lines        9603     9617      +14     
==========================================
+ Hits         7086     7100      +14     
+ Misses       1777     1774       -3     
- Partials      740      743       +3     
Files Coverage Δ
service/datasetworker/datasetworker.go 80.38% <69.23%> (-1.18%) ⬇️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@xinaxu xinaxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great lesson for me. I will need to use the timer in other places of this project too.

@gammazero gammazero merged commit bff2f2e into main Oct 19, 2023
@gammazero gammazero deleted the no-cleanup-goroutine branch October 19, 2023 20:11
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