Merge pull request #3534 from onyx-dot-app/bugfix/validate_ttl

raise activity timeout to one hour
This commit is contained in:
rkuo-danswer 2024-12-22 13:13:57 -08:00 committed by GitHub
commit aaa668c963
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -503,7 +503,11 @@ def validate_indexing_fence(
# celery tasks don't exist and the active signal has expired, possibly due to a crash. Clean it up. # celery tasks don't exist and the active signal has expired, possibly due to a crash. Clean it up.
logger.warning( logger.warning(
f"validate_indexing_fence - Resetting fence because no associated celery tasks were found: fence={fence_key}" f"validate_indexing_fence - Resetting fence because no associated celery tasks were found: "
f"index_attempt={payload.index_attempt_id} "
f"cc_pair={cc_pair_id} "
f"search_settings={search_settings_id} "
f"fence={fence_key}"
) )
if payload.index_attempt_id: if payload.index_attempt_id:
try: try:

View File

@ -118,7 +118,7 @@ class RedisConnectorIndex:
The slack in timing is needed to avoid race conditions where simply checking The slack in timing is needed to avoid race conditions where simply checking
the celery queue and task status could result in race conditions.""" the celery queue and task status could result in race conditions."""
self.redis.set(self.active_key, 0, ex=300) self.redis.set(self.active_key, 0, ex=3600)
def active(self) -> bool: def active(self) -> bool:
if self.redis.exists(self.active_key): if self.redis.exists(self.active_key):
@ -172,6 +172,9 @@ class RedisConnectorIndex:
@staticmethod @staticmethod
def reset_all(r: redis.Redis) -> None: def reset_all(r: redis.Redis) -> None:
"""Deletes all redis values for all connectors""" """Deletes all redis values for all connectors"""
for key in r.scan_iter(RedisConnectorIndex.ACTIVE_PREFIX + "*"):
r.delete(key)
for key in r.scan_iter(RedisConnectorIndex.GENERATOR_LOCK_PREFIX + "*"): for key in r.scan_iter(RedisConnectorIndex.GENERATOR_LOCK_PREFIX + "*"):
r.delete(key) r.delete(key)