diff --git a/app/Actions/Database/StopDatabase.php b/app/Actions/Database/StopDatabase.php index f90851c93..0f074bea9 100644 --- a/app/Actions/Database/StopDatabase.php +++ b/app/Actions/Database/StopDatabase.php @@ -2,6 +2,7 @@ namespace App\Actions\Database; +use App\Actions\Server\CleanupDocker; use App\Models\StandaloneClickhouse; use App\Models\StandaloneDragonfly; use App\Models\StandaloneKeydb; @@ -12,7 +13,6 @@ use App\Models\StandalonePostgresql; use App\Models\StandaloneRedis; use Illuminate\Support\Facades\Process; use Lorisleiva\Actions\Concerns\AsAction; -use App\Actions\Server\CleanupDocker; class StopDatabase { @@ -21,13 +21,12 @@ class StopDatabase public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $database, bool $isDeleteOperation = false, bool $dockerCleanup = true) { $server = $database->destination->server; - if (!$server->isFunctional()) { + if (! $server->isFunctional()) { return 'Server is not functional'; } $this->stopContainer($database, $database->uuid, 300); - if (!$isDeleteOperation) { - $this->deleteConnectedNetworks($database->uuid, $server); //Probably not needed as DBs do not have a network normally + if (! $isDeleteOperation) { if ($dockerCleanup) { CleanupDocker::run($server, true); } diff --git a/app/Jobs/DeleteResourceJob.php b/app/Jobs/DeleteResourceJob.php index 8f7dd806a..37300593e 100644 --- a/app/Jobs/DeleteResourceJob.php +++ b/app/Jobs/DeleteResourceJob.php @@ -4,9 +4,9 @@ namespace App\Jobs; use App\Actions\Application\StopApplication; use App\Actions\Database\StopDatabase; +use App\Actions\Server\CleanupDocker; use App\Actions\Service\DeleteService; use App\Actions\Service\StopService; -use App\Actions\Server\CleanupDocker; use App\Models\Application; use App\Models\Service; use App\Models\StandaloneClickhouse; @@ -35,8 +35,7 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueue public bool $deleteVolumes, public bool $dockerCleanup, public bool $deleteConnectedNetworks - ) { - } + ) {} public function handle() { @@ -84,11 +83,11 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueue CleanupDocker::run($server, true); } - if ($this->deleteConnectedNetworks) { + if ($this->deleteConnectedNetworks && ! $isDatabase) { $this->resource?->delete_connected_networks($this->resource->uuid); } } catch (\Throwable $e) { - send_internal_notification('ContainerStoppingJob failed with: ' . $e->getMessage()); + send_internal_notification('ContainerStoppingJob failed with: '.$e->getMessage()); throw $e; } finally { $this->resource->forceDelete(); diff --git a/app/Livewire/Project/Database/Heading.php b/app/Livewire/Project/Database/Heading.php index 4eca89cb6..765213f60 100644 --- a/app/Livewire/Project/Database/Heading.php +++ b/app/Livewire/Project/Database/Heading.php @@ -78,8 +78,8 @@ class Heading extends Component { return view('livewire.project.database.heading', [ 'checkboxes' => [ - ['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images (the next deployment will take longer as the images have to be pulled again)'], - ] + ['id' => 'docker_cleanup', 'label' => 'Cleanup docker build cache and unused images (next deployment could take longer).'], + ], ]); } } diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php index 529b4f0d2..6b46f2fb6 100644 --- a/resources/views/components/modal-confirmation.blade.php +++ b/resources/views/components/modal-confirmation.blade.php @@ -201,7 +201,7 @@

This operation is permanent and cannot be undone. Please think again before proceeding!

-
The following actions will be performed:
+
The following actions will be performed: