Skip to content

Commit

Permalink
we shouldn't be checking for deletion attempts in the db any more
Browse files Browse the repository at this point in the history
  • Loading branch information
LostVector committed Sep 30, 2024
1 parent 1dfb2c7 commit 820dd01
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 820dd01

Please sign in to comment.