mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 21:11:24 +08:00
Remove instances of 'raise Exception' (#7523)
This commit is contained in:
@@ -141,8 +141,8 @@ class Cluster:
|
||||
exception.
|
||||
|
||||
Raises:
|
||||
Exception: An exception is raised if the timeout expires before the
|
||||
node appears in the client table.
|
||||
TimeoutError: An exception is raised if the timeout expires before
|
||||
the node appears in the client table.
|
||||
"""
|
||||
ip_address, port = self.redis_address.split(":")
|
||||
redis_client = redis.StrictRedis(
|
||||
@@ -158,7 +158,7 @@ class Cluster:
|
||||
return
|
||||
else:
|
||||
time.sleep(0.1)
|
||||
raise Exception("Timed out while waiting for nodes to join.")
|
||||
raise TimeoutError("Timed out while waiting for nodes to join.")
|
||||
|
||||
def wait_for_nodes(self, timeout=30):
|
||||
"""Waits for correct number of nodes to be registered.
|
||||
@@ -174,8 +174,8 @@ class Cluster:
|
||||
before failing.
|
||||
|
||||
Raises:
|
||||
Exception: An exception is raised if we time out while waiting for
|
||||
nodes to join.
|
||||
TimeoutError: An exception is raised if we time out while waiting
|
||||
for nodes to join.
|
||||
"""
|
||||
ip_address, port = self.address.split(":")
|
||||
redis_client = redis.StrictRedis(
|
||||
@@ -195,7 +195,7 @@ class Cluster:
|
||||
"{} nodes are currently registered, but we are expecting "
|
||||
"{}".format(len(live_clients), expected))
|
||||
time.sleep(0.1)
|
||||
raise Exception("Timed out while waiting for nodes to join.")
|
||||
raise TimeoutError("Timed out while waiting for nodes to join.")
|
||||
|
||||
def list_all_nodes(self):
|
||||
"""Lists all nodes.
|
||||
|
||||
Reference in New Issue
Block a user