Skip to content

Commit

Permalink
cloud config connect timeout to 120
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Aug 27, 2024
1 parent 2cb9ee3 commit c442876
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions impl/astra_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from cassandra.query import (
UNSET_VALUE,
SimpleStatement,
ValueSequence,
dict_factory,
named_tuple_factory, PreparedStatement,
)
Expand Down Expand Up @@ -146,7 +145,6 @@ async def async_setup(self):
if self.dbid is None:
await self.get_or_create_db()

# Attempt to connect synchronously (assuming connect is a sync method)
session = self.connect()
if session:
self.session: Session = session
Expand Down Expand Up @@ -337,7 +335,7 @@ def connect(self, retry=False) -> Session:
with open(bundlepath, "wb") as f:
f.write(r.content)
# Connect to the cluster
cloud_config = {"secure_connect_bundle": bundlepath}
cloud_config = {"secure_connect_bundle": bundlepath, "connect_timeout": 120}
auth_provider = PlainTextAuthProvider(CASSANDRA_USER, token)
cluster = Cluster(
cloud=cloud_config,
Expand Down

0 comments on commit c442876

Please sign in to comment.