Skip to content

feat: add TTL support for tags in Memcache store#306

Merged
eko merged 2 commits into
eko:masterfrom
semihbkgr:fix/memcache-tags-ttl
May 3, 2026
Merged

feat: add TTL support for tags in Memcache store#306
eko merged 2 commits into
eko:masterfrom
semihbkgr:fix/memcache-tags-ttl

Conversation

@semihbkgr

Copy link
Copy Markdown
Contributor

Fixes #304.

WithTagsTTL was added in #276 (Redis) and back-filled to Hazelcast in #283, but never wired through the Memcache store — opts.TagsTTL was accepted yet ignored, and tag keys always used the hardcoded TagKeyExpiry (720h).

This PR threads opts.TagsTTL through setTagsaddKeyToTagValue, defaulting to TagKeyExpiry when 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/setTagsWithTTL into a single setTags(..., ttl) matching the new Memcache shape, introduces a TagKeyExpiry constant, and aligns test naming with the Memcache tests. No behavior change.

semihbkgr and others added 2 commits May 2, 2026 17:36
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>

@eko eko left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for managing TTL here.

@eko eko merged commit 6692fac into eko:master May 3, 2026
10 checks passed
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.

Memcache store ignores WithTagsTTL option

2 participants