Files
coolify/app/Traits/ExecutesDatabaseStartCommands.php
T
Andras Bacsai f1f7272494 fix(queue): run service and database start commands on the deployment queue
On cloud, StartService and DeployServiceApplication dispatched their
CoolifyTask on the high queue, so service starts competed with all other
high jobs. remote_process() and CoolifyTask now accept a queue (default
high); start paths pass deployment_queue(). The queued RestartDatabase
action also runs on deployment_queue() instead of the default queue.
2026-10-03 20:50:49 +02:00

20 lines
616 B
PHP

<?php
namespace App\Traits;
use App\Services\DatabaseStartCommandExecutor;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Models\Activity;
trait ExecutesDatabaseStartCommands
{
private function executeDatabaseStartCommands(array $commands, Model $database, ?Activity $activity = null): Activity
{
if ($activity) {
return app(DatabaseStartCommandExecutor::class)->execute($commands, $database, $activity);
}
return remote_process($commands, $database->destination->server, callEventOnFinish: 'DatabaseStatusChanged', queue: deployment_queue());
}
}