Skip to content

feat: add Redis cache invalidation hooks for indexer#366

Merged
kuny0707 merged 1 commit intomasterfrom
feature/cache-invalidation-hook
Mar 12, 2026
Merged

feat: add Redis cache invalidation hooks for indexer#366
kuny0707 merged 1 commit intomasterfrom
feature/cache-invalidation-hook

Conversation

@ety001
Copy link
Member

@ety001 ety001 commented Mar 12, 2026

When a post is created/deleted/undeleted, the indexer now proactively clears the corresponding Redis cache entries to prevent stale "not found" cache from being returned.

Changes:

  • Add hive/utils/redis_cache.py: RedisCacheManager class with sync/async methods for cache invalidation
  • Modify hive/indexer/sync.py: Initialize Redis client at startup
  • Modify hive/indexer/posts.py: Call cache invalidation in insert/delete/undelete methods

When a post is created/deleted/undeleted, the indexer now proactively
clears the corresponding Redis cache entries to prevent
stale "not found" cache from being returned.

Changes:
- Add hive/utils/redis_cache.py: RedisCacheManager class
  with sync/async methods for cache invalidation
- Modify hive/indexer/sync.py: Initialize Redis client
  at startup
- Modify hive/indexer/posts.py: Call cache invalidation
  in insert/delete/undelete methods
@kuny0707 kuny0707 merged commit 64b1434 into master Mar 12, 2026
1 check passed
@ety001 ety001 deleted the feature/cache-invalidation-hook branch March 12, 2026 03:31
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.

2 participants