From c1727e63adeccc0f08cecd12d5d8cdd24a2e1d5e Mon Sep 17 00:00:00 2001 From: Yuhong Sun Date: Thu, 31 Aug 2023 13:39:51 -0700 Subject: [PATCH] bug squashed --- backend/danswer/background/update.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/danswer/background/update.py b/backend/danswer/background/update.py index 6f95b4bf923..54d4baf4855 100755 --- a/backend/danswer/background/update.py +++ b/backend/danswer/background/update.py @@ -76,7 +76,7 @@ def create_indexing_jobs(db_session: Session, existing_jobs: dict[int, Future]) db_session, failure_reason="Stopped mid run, likely due to the background process being killed", ) - if attempt.connector_id and attempt.credential_id: + if attempt.connector_id is not None and attempt.credential_id is not None: update_connector_credential_pair( db_session=db_session, connector_id=attempt.connector_id, @@ -137,7 +137,10 @@ def cleanup_indexing_jobs( db_session=db_session, failure_reason="Stopped mid run, likely due to the background process being killed", ) - if index_attempt.connector_id and index_attempt.credential_id: + if ( + index_attempt.connector_id is not None + and index_attempt.credential_id is not None + ): update_connector_credential_pair( db_session=db_session, connector_id=index_attempt.connector_id,