-
Notifications
You must be signed in to change notification settings - Fork 28
director: renew cache in the background instead of clearing cache #1496
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
director: renew cache in the background instead of clearing cache #1496
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1496 +/- ##
==========================================
- Coverage 71.24% 71.16% -0.08%
==========================================
Files 247 139 -108
Lines 9959 5189 -4770
Branches 1094 501 -593
==========================================
- Hits 7095 3693 -3402
+ Misses 2550 1382 -1168
+ Partials 314 114 -200
Continue to review full report at Codecov.
|
@@ -46,7 +47,7 @@ async def test_registry_caching_task(loop, client, push_services): | |||
number_of_computational_services=1, number_of_interactive_services=1 | |||
) | |||
# the services shall be updated | |||
await sleep(config.DIRECTOR_REGISTRY_CACHING_TTL) | |||
await sleep(config.DIRECTOR_REGISTRY_CACHING_TTL * 1.1) # NOTE: this can take some time. Sleep increased by 10%. |
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.
MINOR: why not simply increasing the variable itself? Is it used somewhere else?
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.
yes it is used by the director registry caching task. the point is to wait longer than him. probably the very right way would be to find the task out and wait for it.
What do these changes do?
Until now the director was caching calls to the registry by clearing the cache every 15 minutes.
Now the background task first gets the new cache and replaces it after success thus there is no time where there is no cache. Unless some error (registry not available) happens.
Related issue number
How to test
Checklist
make openapi-specs
,git commit ...
and thenmake version-*
)