From 820dd01af357d332e9866e55d66e05be0b731070 Mon Sep 17 00:00:00 2001 From: Richard Kuo Date: Sun, 29 Sep 2024 21:20:23 -0700 Subject: [PATCH] we shouldn't be checking for deletion attempts in the db any more --- .../celery/tasks/connector_deletion/tasks.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/backend/danswer/background/celery/tasks/connector_deletion/tasks.py b/backend/danswer/background/celery/tasks/connector_deletion/tasks.py index c6df6c70ac9..edcf7b3ba73 100644 --- a/backend/danswer/background/celery/tasks/connector_deletion/tasks.py +++ b/backend/danswer/background/celery/tasks/connector_deletion/tasks.py @@ -14,10 +14,7 @@ from danswer.db.connector_credential_pair import get_connector_credential_pairs from danswer.db.engine import get_sqlalchemy_engine from danswer.db.enums import ConnectorCredentialPairStatus -from danswer.db.enums import IndexingStatus -from danswer.db.index_attempt import get_last_attempt from danswer.db.models import ConnectorCredentialPair -from danswer.db.search_settings import get_current_search_settings from danswer.redis.redis_pool import RedisPool redis_pool = RedisPool() @@ -88,21 +85,6 @@ def try_generate_document_cc_pair_cleanup_tasks( if cc_pair.status != ConnectorCredentialPairStatus.DELETING: return None - search_settings = get_current_search_settings(db_session) - - last_indexing = get_last_attempt( - connector_id=cc_pair.connector_id, - credential_id=cc_pair.credential_id, - search_settings_id=search_settings.id, - db_session=db_session, - ) - if last_indexing: - if ( - last_indexing.status == IndexingStatus.IN_PROGRESS - or last_indexing.status == IndexingStatus.NOT_STARTED - ): - return None - # add tasks to celery and build up the task set to monitor in redis r.delete(rcd.taskset_key)