mirror of
https://github.com/unraid/webgui.git
synced 2026-01-18 07:30:14 -06:00
Merge pull request #750 from Squidly271/docker_timeout
Add customizable timeout when stopping containers
This commit is contained in:
@@ -145,6 +145,11 @@ _(Enable Docker)_:
|
||||
|
||||
:docker_enable_help:
|
||||
|
||||
_(Docker Stop Timeout)_:
|
||||
: <input id="DOCKER_TIMEOUT" type="number" name="DOCKER_TIMEOUT" min='1' value="<?=$dockercfg['DOCKER_TIMEOUT']?>">
|
||||
|
||||
:docker_timeout_help:
|
||||
|
||||
<?if ($DockerStopped):?>
|
||||
|
||||
_(Docker data-root)_:
|
||||
|
||||
@@ -5,4 +5,5 @@ DOCKER_LOG_SIZE="50m"
|
||||
DOCKER_LOG_FILES="1"
|
||||
DOCKER_AUTHORING_MODE="no"
|
||||
DOCKER_USER_NETWORKS="remove"
|
||||
DOCKER_ALLOW_ACCESS=""
|
||||
DOCKER_ALLOW_ACCESS=""
|
||||
DOCKER_TIMEOUT=10
|
||||
@@ -747,7 +747,11 @@ class DockerClient {
|
||||
return $code;
|
||||
}
|
||||
|
||||
public function stopContainer($id, $t=10) {
|
||||
public function stopContainer($id, $t=false) {
|
||||
global $dockercfg;
|
||||
|
||||
if ( ! $t )
|
||||
$t = intval($dockercfg['DOCKER_TIMEOUT']) ?: 10;
|
||||
$this->getDockerJSON("/containers/$id/stop?t=$t", 'POST', $code);
|
||||
$this->flushCache($this::$containersCache);
|
||||
return $code;
|
||||
|
||||
Reference in New Issue
Block a user