Skip to content

Commit

Permalink
added condition to catch timed out error
Browse files Browse the repository at this point in the history
  • Loading branch information
star-nox committed Dec 16, 2024
1 parent 4da4174 commit 498b943
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ai_ta_backend/beam/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,18 +1164,16 @@ def split_and_upload(self, texts: List[str], metadatas: List[Dict[str, Any]], **
collection_name=os.environ['QDRANT_COLLECTION_NAME'], # type: ignore
points=vectors, # type: ignore
)
except Timeout as e:
# it's fine if this gets timeout error. it will still post, according to devs: https://github.com/qdrant/qdrant/issues/3654
print(
"Warning: all update and/or upsert timeouts are fine (completed in background), but errors might not be: ",
e)
pass
except Exception as e:
# log other exceptions
logging.error("Error in QDRANT upload: ", exc_info=True)
err = f"Error in QDRANT upload: {e}"
sentry_sdk.capture_exception(e)
raise Exception(err)
if "timed out" in str(e):
# timed out error is fine, task will continue in background
pass
else:
print(err)
sentry_sdk.capture_exception(e)
raise Exception(err)

### Supabase SQL ###
contexts_for_supa = [{
Expand Down

0 comments on commit 498b943

Please sign in to comment.