mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-18 19:43:26 +02:00
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:
@@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user