mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-20 21:33:56 +02:00
dont add to the lookup table if it already exists
This commit is contained in:
@@ -897,7 +897,9 @@ def monitor_vespa_sync(self: Task, tenant_id: str | None) -> bool | None:
|
||||
# this is just a migration concern and should be unnecessary once
|
||||
# lookup tables are rolled out
|
||||
for key_bytes in r_replica.scan_iter(count=SCAN_ITER_COUNT_DEFAULT):
|
||||
if is_fence(key_bytes):
|
||||
if is_fence(key_bytes) and not r.sismember(
|
||||
OnyxRedisConstants.ACTIVE_FENCES, key_bytes
|
||||
):
|
||||
logger.warning(f"Adding {key_bytes} to the lookup table.")
|
||||
r.sadd(OnyxRedisConstants.ACTIVE_FENCES, key_bytes)
|
||||
|
||||
|
@@ -114,6 +114,7 @@ class TenantRedis(redis.Redis):
|
||||
"create_lock",
|
||||
"startswith",
|
||||
"smembers",
|
||||
"sismember",
|
||||
"sadd",
|
||||
"srem",
|
||||
"scard",
|
||||
|
Reference in New Issue
Block a user