Skip to content

Commit 81870ea

Browse files
Add a client timeout of 3600 sec
1 parent 319a90c commit 81870ea

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/imaging_server_kit/core/client.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
from imaging_server_kit.core.serialization import deserialize_results
2323

2424

25+
TIMEOUT_SEC = 3600 # Timeout for the /process route (in seconds)
26+
27+
2528
class Client(AlgorithmRunner):
2629
"""Client to connect to and interact with algorithm servers.
2730
@@ -181,7 +184,7 @@ def _tile(
181184

182185
def _run(self, algorithm: str, param_results: Results) -> Results:
183186
endpoint = f"{self.server_url}/{algorithm}/process"
184-
with httpx.Client(base_url=self.server_url) as client:
187+
with httpx.Client(base_url=self.server_url, timeout=TIMEOUT_SEC) as client:
185188
try:
186189
response = client.post(
187190
endpoint,

‎src/imaging_server_kit/core/results.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def read(self, layer_name: str) -> Optional[DataLayer]:
234234
return layer
235235

236236
def update(
237-
self, layer_name: str, updated_data: np.ndarray, updated_meta: Dict
237+
self, layer_name: str, updated_data: Any, updated_meta: Dict
238238
) -> Optional[DataLayer]:
239239
"""Update the data and meta attributes of a layer."""
240240
layer = self.read(layer_name)

0 commit comments

Comments
 (0)