This commit is contained in:
Alexzvn
2024-07-29 08:09:27 +00:00
parent 342ef4d367
commit 1feb8488a3

View File

@@ -2029,20 +2029,18 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
*/
private function graceful_shutdown_container(string $containerName, int $timeout = 300) {
try {
$this->execute_remote_command(
return $this->execute_remote_command(
["docker stop --time=$timeout $containerName > /dev/null 2>&1", 'hidden' => true],
["docker rm $containerName > /dev/null 2>&1", 'hidden' => true]
);
return;
} catch (\Exception $error) {
// report error if needed
} finally {
}
$this->execute_remote_command(
["docker rm -f $containerName >/dev/null 2>&1", 'hidden' => true, 'ignore_errors' => true]
);
}
}
private function stop_running_container(bool $force = false)
{