Skip to content

Commit

Permalink
Fix the issue that wait_for_available fails to get the status of a cl…
Browse files Browse the repository at this point in the history
…uster when creating

Signed-off-by: Aolin <[email protected]>
  • Loading branch information
Oreoxmt committed Dec 5, 2022
1 parent ac1f4b0 commit 6ecac49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tidbcloudy/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ def wait_for_available(self, *, timeout_sec: int = None, interval_sec: int = 10)
cluster_config = CreateClusterConfig()
cluster_config.set_name("your_cluster_name").set_cluster_type("your_cluster_type").set_cloud_provider("your_cloud_provider").set_region("your_region").set_port(4000).set_root_password("your_root_password")
cluster = project.create_cluster(cluster_config)
cluster.wait_for_ready()
cluster.wait_for_available()
"""
time_start = time.monotonic()
counter = 1
log("Cluster id={} is {}".format(self.id, self.status.cluster_status.value))
while True:
duration = time.monotonic() - time_start
minutes = duration - 60 * counter
Expand Down

0 comments on commit 6ecac49

Please sign in to comment.