fix: service deletion bug!

This commit is contained in:
Andras Bacsai
2024-01-17 15:48:01 +01:00
parent 1e158badfc
commit af01bc3e77
3 changed files with 11 additions and 4 deletions

View File

@@ -31,11 +31,16 @@ class DeleteResourceJob implements ShouldQueue, ShouldBeEncrypted
{
try {
$server = $this->resource->destination->server;
$this->resource->delete();
if (!$server->isFunctional()) {
$this->resource->forceDelete();
if ($this->resource->type() === 'service') {
ray('dispatching delete service');
DeleteService::dispatch($this->resource);
} else {
$this->resource->forceDelete();
}
return 'Server is not functional';
}
$this->resource->delete();
switch ($this->resource->type()) {
case 'application':
StopApplication::run($this->resource);