2026-03-29 03:03:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Actions\Service;
|
|
|
|
|
|
|
|
|
|
use App\Models\ServiceApplication;
|
2026-07-15 10:29:58 +00:00
|
|
|
use App\Models\ServiceDatabase;
|
2026-03-29 03:03:47 +00:00
|
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
|
|
|
|
|
|
class RestartServiceApplication
|
|
|
|
|
{
|
|
|
|
|
use AsAction;
|
|
|
|
|
|
|
|
|
|
public string $jobQueue = 'high';
|
|
|
|
|
|
2026-07-15 10:29:58 +00:00
|
|
|
public function handle(ServiceApplication|ServiceDatabase $serviceApplication): void
|
2026-03-29 03:03:47 +00:00
|
|
|
{
|
|
|
|
|
$service = $serviceApplication->service;
|
|
|
|
|
$server = $service->destination->server;
|
2026-07-07 13:10:24 +00:00
|
|
|
$containerName = escapeshellarg($serviceApplication->name.'-'.$service->uuid);
|
2026-03-29 03:03:47 +00:00
|
|
|
|
|
|
|
|
instant_remote_process([
|
|
|
|
|
"docker restart {$containerName}",
|
|
|
|
|
], $server);
|
|
|
|
|
}
|
|
|
|
|
}
|