Skip to content

Commit bf7408a

Browse files
author
Andrei Neagu
committed
using limited_gather
1 parent 525bce1 commit bf7408a

File tree

1 file changed

+7
-6
lines changed
  • services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules

1 file changed

+7
-6
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from servicelib.file_utils import remove_directory
2626
from servicelib.logging_utils import log_context
2727
from servicelib.progress_bar import ProgressBarData
28-
from servicelib.utils import logged_gather
28+
from servicelib.utils import limited_gather
2929
from simcore_sdk import node_ports_v2
3030
from simcore_sdk.node_ports_common.file_io_utils import LogRedirectCB
3131
from simcore_sdk.node_ports_v2 import Port
@@ -120,8 +120,9 @@ async def upload_outputs(
120120
if (not port_keys) or (port_value.key in port_keys)
121121
]
122122

123-
await logged_gather(
124-
*(port_notifier.send_output_port_upload_sarted(p.key) for p in ports_to_set)
123+
await limited_gather(
124+
*(port_notifier.send_output_port_upload_sarted(p.key) for p in ports_to_set),
125+
limit=4,
125126
)
126127

127128
async with AsyncExitStack() as stack:
@@ -218,7 +219,7 @@ async def _archive_dir_notified(
218219
logger.debug("No file %s to fetch port values from", data_file)
219220

220221
if archiving_tasks:
221-
await logged_gather(*archiving_tasks)
222+
await limited_gather(*archiving_tasks, limit=4)
222223

223224
await PORTS.set_multiple(
224225
ports_values,
@@ -354,7 +355,7 @@ async def _get_date_from_port_notified(
354355
async with progress_bar.sub_progress(
355356
steps=len(ports_to_get), description=IDStr("downloading")
356357
) as sub_progress:
357-
results = await logged_gather(
358+
results = await limited_gather(
358359
*[
359360
(
360361
_get_data_from_port(
@@ -365,7 +366,7 @@ async def _get_date_from_port_notified(
365366
)
366367
for port in ports_to_get
367368
],
368-
max_concurrency=2,
369+
limit=2,
369370
)
370371
# parse results
371372
data = {

0 commit comments

Comments
 (0)