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

fixed to call janitor run method #27

Merged
merged 6 commits into from
Sep 18, 2022
Merged

fixed to call janitor run method #27

merged 6 commits into from
Sep 18, 2022

Conversation

Code-Hex
Copy link
Owner

@codecov
Copy link

codecov bot commented Sep 18, 2022

Codecov Report

Merging #27 (9790bda) into main (52983e9) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #27   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          524       520    -4     
=========================================
- Hits           524       520    -4     
Impacted Files Coverage Δ
janitor.go 100.00% <ø> (ø)
cache.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Code-Hex
Copy link
Owner Author

Previously, the janitor held in New was not stopped because SetFinalizer was not called. Therefore I have changed the specification in 9790bda.

I explain here why it is not stopped.

  1. The janitor is stopped when the cache is not referenced anywhere.
  2. The cache is referenced in the janitor run method.
  3. The cache is always referenced. So It will be not called a finalizer.

If you want to stop the janitor gracefully, You must use the NewContext function.

@Code-Hex Code-Hex merged commit 08190fb into main Sep 18, 2022
@Code-Hex Code-Hex deleted the fix/call-janitor-run branch September 18, 2022 09:14
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.

None yet

1 participant