From b349f16090886cf4d7905c160df0e4c1b775ee14 Mon Sep 17 00:00:00 2001 From: cedric-crouzet-penbase Date: Wed, 13 Jun 2018 16:04:24 +0200 Subject: [PATCH] fix(containers): remove hardcoded container stop/restart timeout REST call to stop/restart a container overrides the default stop timeout (before kill) with hardcoded 5 seconds. Containers already have a default stop timeout handled by the engine API (https://github.com/moby/moby/blob/master/client/container_stop.go). With this hardcoded 5 seconds, the containers get killed after 5 seconds even if they define a custom greater stop timeout. Another solution would be to not hardcode the 5 seconds but rather use a global editable setting. --- app/docker/rest/container.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/docker/rest/container.js b/app/docker/rest/container.js index 9f35d18d8..d100d5a1c 100644 --- a/app/docker/rest/container.js +++ b/app/docker/rest/container.js @@ -15,10 +15,10 @@ function ContainerFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) { method: 'GET', params: { action: 'json' } }, stop: { - method: 'POST', params: { id: '@id', t: 5, action: 'stop' } + method: 'POST', params: { id: '@id', action: 'stop' } }, restart: { - method: 'POST', params: { id: '@id', t: 5, action: 'restart' } + method: 'POST', params: { id: '@id', action: 'restart' } }, kill: { method: 'POST', params: { id: '@id', action: 'kill' }