Bugfix/harden activity timeout (#4545)

* add some hardening

* add info memory logging

* fix last_observed

* remove log spam

* properly cache last activity details

* default values

---------

Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
This commit is contained in:
rkuo-danswer
2025-04-17 19:28:22 -07:00
committed by GitHub
parent a8a5a82251
commit fa80842afe
4 changed files with 56 additions and 15 deletions

View File

@@ -165,6 +165,16 @@ class RedisConnectorIndex:
return False
def connector_active_ttl(self) -> int:
"""Refer to https://redis.io/docs/latest/commands/ttl/
-2 means the key does not exist
-1 means the key exists but has no associated expire
Otherwise, returns the actual TTL of the key
"""
ttl = cast(int, self.redis.ttl(self.connector_active_key))
return ttl
def generator_locked(self) -> bool:
return bool(self.redis.exists(self.generator_lock_key))