resource->forceDelete(); switch ($this->resource->type()) { case 'application': StopApplication::run($this->resource); break; case 'standalone-postgresql': case 'standalone-redis': case 'standalone-mongodb': case 'standalone-mysql': case 'standalone-mariadb': StopDatabase::run($this->resource); break; case 'service': StopService::run($this->resource); DeleteService::run($this->resource); break; } } catch (\Throwable $e) { ray($e->getMessage()); send_internal_notification('ContainerStoppingJob failed with: ' . $e->getMessage()); throw $e; } finally { Artisan::queue('cleanup:stucked-resources'); } } }