Skip to content

Commit 61044d7

Browse files
committed
Add debugging messages
1 parent 6d6b505 commit 61044d7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

singlestoredb/management/manager.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def _wait_on_endpoint(
323323
Parameters
324324
----------
325325
out : Any
326-
Workspace object with an endpoint attribute
326+
Workspace object with a connect method
327327
interval : int, optional
328328
Interval between each connection attempt (default: 10 seconds)
329329
timeout : int, optional
@@ -339,18 +339,15 @@ def _wait_on_endpoint(
339339
Same object type as `out`
340340
341341
"""
342-
if not hasattr(out, 'endpoint') or not out.endpoint:
342+
if not hasattr(out, 'connect') or not out.connect:
343343
raise ManagementError(
344344
msg=f'{type(out).__name__} object does not have a valid endpoint',
345345
)
346346

347-
# Import connection module here to avoid circular imports
348-
from .. import connection
349-
350347
while True:
351348
try:
352349
# Try to establish a connection to the endpoint using context manager
353-
with connection.connect(host=out.endpoint, connect_timeout=5):
350+
with out.connect(connect_timeout=5):
354351
pass
355352
# If connection succeeds, endpoint is ready
356353
print('CONNECTED')

0 commit comments

Comments
 (0)