Skip to content

Commit

Permalink
add logging when cc_pair isn't present
Browse files Browse the repository at this point in the history
  • Loading branch information
LostVector committed Sep 30, 2024
1 parent 13de66a commit 397fbfd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions backend/danswer/background/celery/tasks/vespa/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ def monitor_connector_deletion_taskset(key_bytes: bytes, r: Redis) -> None:
with Session(get_sqlalchemy_engine()) as db_session:
cc_pair = get_connector_credential_pair_from_id(cc_pair_id, db_session)
if not cc_pair:
task_logger.warning(
f"monitor_connector_deletion_taskset - cc_pair_id not found: cc_pair_id={cc_pair_id}"
)
return

try:
Expand Down Expand Up @@ -407,9 +410,11 @@ def monitor_connector_deletion_taskset(key_bytes: bytes, r: Redis) -> None:
raise e

task_logger.info(
f"Successfully deleted connector_credential_pair with connector_id: '{cc_pair.connector_id}' "
f"and credential_id: '{cc_pair.credential_id}'. "
f"Deleted {initial_count} docs."
f"Successfully deleted cc_pair: "
f"cc_pair_id={cc_pair_id} "
f"connector_id={cc_pair.connector_id} "
f"credential_id={cc_pair.credential_id} "
f"docs_deleted={initial_count}"
)

r.delete(rcd.taskset_key)
Expand Down

0 comments on commit 397fbfd

Please sign in to comment.