File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/ansys/geometry/core/connection Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -93,15 +93,11 @@ def wait_until_healthy(channel: grpc.Channel | str, timeout: float) -> grpc.Chan
93
93
t_out = 0.1
94
94
95
95
# 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
98
97
99
98
while time .time () < t_max :
100
99
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 )
105
101
request = health_pb2 .HealthCheckRequest (service = "" )
106
102
107
103
out = health_stub .Check (request , timeout = t_out )
@@ -117,12 +113,12 @@ def wait_until_healthy(channel: grpc.Channel | str, timeout: float) -> grpc.Chan
117
113
t_out = t_max - t_now
118
114
continue
119
115
else :
120
- target_str = tmp_channel ._channel .target ().decode ()
116
+ target_str = channel ._channel .target ().decode ()
121
117
raise TimeoutError (
122
118
f"Channel health check to target '{ target_str } ' timed out after { timeout } seconds."
123
119
)
124
120
125
- return tmp_channel
121
+ return channel
126
122
127
123
128
124
class GrpcClient :
You can’t perform that action at this time.
0 commit comments