fix: Stop resources gracefully

This commit is contained in:
Andras Bacsai
2024-08-06 13:27:06 +02:00
parent 35e62a3003
commit e897eb2999
4 changed files with 15 additions and 13 deletions

View File

@@ -22,10 +22,11 @@ class StopDatabase
if (! $server->isFunctional()) {
return 'Server is not functional';
}
instant_remote_process(
["docker rm -f {$database->uuid}"],
$server
);
instant_remote_process(command: ["docker stop --time=30 $database->uuid"], server: $server, throwError: false);
instant_remote_process(command: ["docker rm $database->uuid"], server: $server, throwError: false);
instant_remote_process(command: ["docker rm -f $database->uuid"], server: $server, throwError: false);
if ($database->is_public) {
StopDatabaseProxy::run($database);
}