feat: able to delete configuration from server

This commit is contained in:
Andras Bacsai
2024-04-12 10:54:25 +02:00
parent 8b668cf8b7
commit 9032879e20
16 changed files with 127 additions and 10 deletions

View File

@@ -28,7 +28,7 @@ class DeleteResourceJob implements ShouldQueue, ShouldBeEncrypted
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct(public Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $resource)
public function __construct(public Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $resource, public bool $deleteConfigurations = false)
{
}
@@ -55,6 +55,9 @@ class DeleteResourceJob implements ShouldQueue, ShouldBeEncrypted
DeleteService::run($this->resource);
break;
}
if ($this->deleteConfigurations) {
$this->resource?->delete_configurations();
}
} catch (\Throwable $e) {
ray($e->getMessage());
send_internal_notification('ContainerStoppingJob failed with: ' . $e->getMessage());