MCPcopy Create free account
hub / github.com/ExtendDB/extenddb / wait_for_active

Function wait_for_active

samples/sample_app.py:70–80  ·  view source on GitHub ↗

Poll DescribeTable until the table reaches ACTIVE status.

(client, table_name: str, timeout: float = 30.0)

Source from the content-addressed store, hash-verified

68# ---------------------------------------------------------------------------
69
70def wait_for_active(client, table_name: str, timeout: float = 30.0) -> None:
71 """Poll DescribeTable until the table reaches ACTIVE status."""
72 deadline = time.monotonic() + timeout
73 while time.monotonic() < deadline:
74 resp = client.describe_table(TableName=table_name)
75 status = resp["Table"]["TableStatus"]
76 if status == "ACTIVE":
77 print(f" ✓ {table_name} is ACTIVE")
78 return
79 time.sleep(0.3)
80 raise TimeoutError(f"{table_name} did not become ACTIVE within {timeout}s")
81def section(title: str) -> None:
82 """Print a section header."""
83 print(f"\n{'='*60}")

Callers 1

wait_for_tablesFunction · 0.70

Calls 1

describe_tableMethod · 0.80

Tested by

no test coverage detected