Skip to content

Commit

Permalink
Merge pull request #348 from UIUC-Chatbot/ingest-qdrant-fix
Browse files Browse the repository at this point in the history
Handling "timed out" error from QDRANT
  • Loading branch information
star-nox authored Dec 16, 2024
2 parents 4da4174 + 498b943 commit 5e59e97
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 5e59e97

Please sign in to comment.