Skip to content

Commit 36e4427

Browse files
GitHKAndrei Neagupcrespov
authored
logs fetching is resumed and restarted each time the service is reloaded (ITISFoundation#2822)
Co-authored-by: Andrei Neagu <[email protected]> Co-authored-by: Pedro Crespo-Valero <[email protected]>
1 parent 5bfec5c commit 36e4427

File tree

1 file changed

+7
-0
lines changed
  • services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api

1 file changed

+7
-0
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ async def restarts_containers(
525525
command_timeout: float = Query(
526526
10.0, description="docker-compose stop command timeout default"
527527
),
528+
app: FastAPI = Depends(get_application),
528529
settings: DynamicSidecarSettings = Depends(get_settings),
529530
shared_store: SharedStore = Depends(get_shared_store),
530531
rabbitmq: RabbitMQ = Depends(get_rabbitmq),
@@ -539,6 +540,9 @@ async def restarts_containers(
539540
detail="No spec for docker-compose command was found",
540541
)
541542

543+
for container_name in shared_store.container_names:
544+
await stop_log_fetching(app, container_name)
545+
542546
command = (
543547
"docker-compose --project-name {project} --file {file_path} "
544548
"restart --timeout {stop_and_remove_timeout}"
@@ -555,6 +559,9 @@ async def restarts_containers(
555559
logger.warning(error_message)
556560
raise HTTPException(status.HTTP_422_UNPROCESSABLE_ENTITY, detail=stdout)
557561

562+
for container_name in shared_store.container_names:
563+
await start_log_fetching(app, container_name)
564+
558565
await _send_message(rabbitmq, "Service was restarted please reload the UI")
559566
await rabbitmq.send_event_reload_iframe()
560567

0 commit comments

Comments
 (0)