mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-20 13:05:49 +02:00
using is_up_to_date cached outside of the fence was causing a race condition where the same sync could be kicked off again (#2433)
This commit is contained in:
@@ -274,6 +274,8 @@ def try_generate_document_set_sync_tasks(
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
# don't generate sync tasks if we're up to date
|
# don't generate sync tasks if we're up to date
|
||||||
|
# race condition with the monitor/cleanup function if we use a cached result!
|
||||||
|
db_session.refresh(document_set)
|
||||||
if document_set.is_up_to_date:
|
if document_set.is_up_to_date:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -316,6 +318,8 @@ def try_generate_user_group_sync_tasks(
|
|||||||
if r.exists(rug.fence_key):
|
if r.exists(rug.fence_key):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# race condition with the monitor/cleanup function if we use a cached result!
|
||||||
|
db_session.refresh(usergroup)
|
||||||
if usergroup.is_up_to_date:
|
if usergroup.is_up_to_date:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user