Skip to content

Commit 865746c

Browse files
committed
test: v2
1 parent e9f2427 commit 865746c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/ansys/geometry/core/connection/client.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,11 @@ def wait_until_healthy(channel: grpc.Channel | str, timeout: float) -> grpc.Chan
9393
t_out = 0.1
9494

9595
# If the channel is a string, create a channel using the default insecure channel
96-
channel_creation_required = True if isinstance(channel, str) else False
97-
tmp_channel = None
96+
channel = _create_geometry_channel(channel) if isinstance(channel, str) else channel
9897

9998
while time.time() < t_max:
10099
try:
101-
tmp_channel = (
102-
_create_geometry_channel(channel) if channel_creation_required else channel
103-
)
104-
health_stub = health_pb2_grpc.HealthStub(tmp_channel)
100+
health_stub = health_pb2_grpc.HealthStub(channel)
105101
request = health_pb2.HealthCheckRequest(service="")
106102

107103
out = health_stub.Check(request, timeout=t_out)
@@ -117,12 +113,12 @@ def wait_until_healthy(channel: grpc.Channel | str, timeout: float) -> grpc.Chan
117113
t_out = t_max - t_now
118114
continue
119115
else:
120-
target_str = tmp_channel._channel.target().decode()
116+
target_str = channel._channel.target().decode()
121117
raise TimeoutError(
122118
f"Channel health check to target '{target_str}' timed out after {timeout} seconds."
123119
)
124120

125-
return tmp_channel
121+
return channel
126122

127123

128124
class GrpcClient:

0 commit comments

Comments
 (0)