-
Notifications
You must be signed in to change notification settings - Fork 66
fix: do not delete cache on destroy #391
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
Changes from all commits
360839b
cd4d391
235054e
a0b7a97
3e7ceb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -451,7 +451,12 @@ def feature_definitions(self) -> dict: | |||||||||||||||||||
|
|
||||||||||||||||||||
| def destroy(self) -> None: | ||||||||||||||||||||
| """ | ||||||||||||||||||||
| Gracefully shuts down the Unleash client by stopping jobs, stopping the scheduler, and deleting the cache. | ||||||||||||||||||||
| Gracefully shuts down the Unleash client by stopping jobs and stopping | ||||||||||||||||||||
| the scheduler. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| For cache teardown: | ||||||||||||||||||||
| - Default disk-backed FileCache instances are preserved on disk. | ||||||||||||||||||||
| - Custom non-FileCache implementations will have destroy() called. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| You shouldn't need this too much! | ||||||||||||||||||||
| """ | ||||||||||||||||||||
|
|
@@ -487,10 +492,13 @@ def destroy(self) -> None: | |||||||||||||||||||
| except Exception as exc: | ||||||||||||||||||||
| LOGGER.warning("Exception during scheduler teardown: %s", exc) | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
||||||||||||||||||||
| # Tear down custom caches while keeping FileCache contents on disk. | |
| cache = getattr(self, "cache", None) | |
| if cache and not isinstance(cache, FileCache): | |
| try: | |
| cache.destroy() | |
| except Exception as exc: | |
| LOGGER.warning("Exception during cache teardown: %s", exc) |
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.
destroy()'s docstring mentions deleting the cache, but cache teardown is no longer performed here. Please update the docstring to match the new behavior (e.g., preserveFileCacheon disk while optionally destroying custom caches).