We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8e09eb commit 72c30c4Copy full SHA for 72c30c4
src/nipanel/_panel_client.py
@@ -4,6 +4,7 @@
4
5
import logging
6
import threading
7
+import time
8
from typing import Callable, TypeVar
9
10
import grpc
@@ -178,7 +179,9 @@ def _invoke_with_retry(
178
179
) -> _T:
180
"""Invoke a gRPC method with retry logic."""
181
try:
- return method(*args, **kwargs)
182
+ retval = method(*args, **kwargs)
183
+ time.sleep(0.001) # limit gRPC call rate to avoid overwhelming the server
184
+ return retval
185
except grpc.RpcError as e:
186
if e.code() == grpc.StatusCode.UNAVAILABLE or e.code() == grpc.StatusCode.UNKNOWN:
187
# if the service is unavailable, we can retry the connection
0 commit comments