Skip to content

return only non-expired keys in the cache#41

Merged
mamantoha merged 3 commits intomainfrom
fix-keys
Jul 8, 2025
Merged

return only non-expired keys in the cache#41
mamantoha merged 3 commits intomainfrom
fix-keys

Conversation

@mamantoha
Copy link
Member

Fixes #40

@mamantoha mamantoha merged commit c8b8236 into main Jul 8, 2025
8 checks passed
@mamantoha mamantoha deleted the fix-keys branch July 8, 2025 10:20
@zw963
Copy link
Contributor

zw963 commented Jul 8, 2025

Thank you very much for fix this so quickly!

I was just thinking about looking at the code and try make a PR ...

@zw963
Copy link
Contributor

zw963 commented Jul 8, 2025

Just for mention, I saw you do some delete op in the File and Memory store impl methods, so, for the third-party store impl, maybe need do same changes?

Anyway, I thought the #keys method always return the correct Set because we do the select on it.

@mamantoha
Copy link
Member Author

@zw963 I’m not sure. At least with the Redis cache I primarily use, there’s no need for a delete operation since key expiration is handled by Redis itself. Additionally, it’s technically not feasible for Redis cache implementation to return all cached keys. And frankly, it’s unnecessary

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.

[bug] cache#keys return the expired and not exists keys.

2 participants