31 lines
753 B
PHP
31 lines
753 B
PHP
<?php
|
|
|
|
namespace App\Provisioning\Jobs;
|
|
|
|
use App\Models\ProvisioningRun;
|
|
use App\Provisioning\RunRunner;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class AdvanceRunJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public function __construct(public string $runUuid)
|
|
{
|
|
$this->onQueue('provisioning');
|
|
}
|
|
|
|
public function handle(RunRunner $runner): void
|
|
{
|
|
$run = ProvisioningRun::query()->where('uuid', $this->runUuid)->first();
|
|
|
|
if ($run !== null) {
|
|
$runner->advance($run);
|
|
}
|
|
}
|
|
}
|