feat: toggle cache via feature flag

This commit is contained in:
Shivam Mishra
2025-03-26 18:46:42 +05:30
parent 37ceac4cd3
commit c4a66346c9
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -184,7 +184,7 @@ class ConversationFinder
end
def should_cache?
true
current_account.feature_enabled?('cache_meta_counts')
end
def cache_key
@@ -192,6 +192,7 @@ class ConversationFinder
end
def cache_expiry(unassigned_count)
# these numbers are intentionally chosen to balance between cache hit rate and freshness
return 5.seconds if unassigned_count < 100
return 10.seconds if unassigned_count < 200
return 15.seconds if unassigned_count < 500
+3
View File
@@ -161,3 +161,6 @@
- name: search_with_gin
display_name: Search messages with GIN
enabled: false
- name: cache_meta_counts
display_name: Cache Meta Counts
enabled: false