feat: add TTL support for tags in Memcache store#306
Merged
Conversation
The WithTagsTTL option introduced in eko#276 (Redis) and back-filled to Hazelcast in eko#283 was never wired through the Memcache store — opts.TagsTTL was accepted but ignored, and tag keys always used the hardcoded TagKeyExpiry (720h). Threads opts.TagsTTL through setTags → addKeyToTagValue, defaulting to TagKeyExpiry when zero so existing default behavior is preserved. Fixes eko#304. Also includes a small drive-by cleanup in the Redis store: collapses setTags/setTagsWithTTL into a single setTags(..., ttl) (matching the new Memcache shape), introduces a TagKeyExpiry constant, and aligns test naming/style with the Memcache tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #304.
WithTagsTTLwas added in #276 (Redis) and back-filled to Hazelcast in #283, but never wired through the Memcache store —opts.TagsTTLwas accepted yet ignored, and tag keys always used the hardcodedTagKeyExpiry(720h).This PR threads
opts.TagsTTLthroughsetTags→addKeyToTagValue, defaulting toTagKeyExpirywhen zero so existing behavior is preserved. Two new tests cover the Add and CAS paths with a custom TTL.Also includes a small drive-by cleanup in the Redis store: collapses
setTags/setTagsWithTTLinto a singlesetTags(..., ttl)matching the new Memcache shape, introduces aTagKeyExpiryconstant, and aligns test naming with the Memcache tests. No behavior change.