mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-26 03:48:49 +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
|
# this is just a migration concern and should be unnecessary once
|
||||||
# lookup tables are rolled out
|
# lookup tables are rolled out
|
||||||
for key_bytes in r_replica.scan_iter(count=SCAN_ITER_COUNT_DEFAULT):
|
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.")
|
logger.warning(f"Adding {key_bytes} to the lookup table.")
|
||||||
r.sadd(OnyxRedisConstants.ACTIVE_FENCES, key_bytes)
|
r.sadd(OnyxRedisConstants.ACTIVE_FENCES, key_bytes)
|
||||||
|
|
||||||
|
@@ -114,6 +114,7 @@ class TenantRedis(redis.Redis):
|
|||||||
"create_lock",
|
"create_lock",
|
||||||
"startswith",
|
"startswith",
|
||||||
"smembers",
|
"smembers",
|
||||||
|
"sismember",
|
||||||
"sadd",
|
"sadd",
|
||||||
"srem",
|
"srem",
|
||||||
"scard",
|
"scard",
|
||||||
|
Reference in New Issue
Block a user