@@ -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