Skip to content

fix(cache): clear expired entries safely - #961

Open
Mr-Neutr0n wants to merge 1 commit into
NanmiCoder:mainfrom
Mr-Neutr0n:fix/cache-clear-expired-entries
Open

fix(cache): clear expired entries safely#961
Mr-Neutr0n wants to merge 1 commit into
NanmiCoder:mainfrom
Mr-Neutr0n:fix/cache-clear-expired-entries

Conversation

@Mr-Neutr0n

Copy link
Copy Markdown

Summary

  • snapshot expired cache keys before deleting them
  • avoid mutating the cache dictionary while iterating over it
  • add regression coverage for multiple entries expiring in one cleanup pass

Verification

  • pytest -q test/test_expiring_local_cache.py --disable-warnings
  • 4 passed
  • python3 -m py_compile cache/local_cache.py test/test_expiring_local_cache.py

The repository preflight currently reports NOASSERTION for the upstream license; this PR changes only the existing cache implementation and tests.

Signed-off-by: Mr-Neutr0n <harikp2002@gmail.com>
@Mr-Neutr0n
Mr-Neutr0n requested a review from NanmiCoder as a code owner August 12, 2026 12:30
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant