Skip to content

Commit

Permalink
Merge pull request #347 from UIUC-Chatbot/qdrant-fix
Browse files Browse the repository at this point in the history
Managing QDRANT upload errors
  • Loading branch information
rohan-uiuc authored Dec 16, 2024
2 parents 1f71e40 + 549f5a8 commit 4da4174
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ai_ta_backend/beam/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
from qdrant_client import QdrantClient, models
from qdrant_client.models import PointStruct
from supabase.client import ClientOptions
from requests.exceptions import Timeout


sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN"),
Expand Down Expand Up @@ -1162,12 +1164,18 @@ 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 Exception as e:
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)

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

0 comments on commit 4da4174

Please sign in to comment.