Initial commit

This commit is contained in:
Zdeněk Burda
2026-01-09 21:26:40 +01:00
parent e83aec6dca
commit 41e3ce6f25
404 changed files with 61250 additions and 28 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Jobs;
use App\Models\EvaluationRun;
use App\Services\Evaluation\EvaluationCoordinator;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Throwable;
/**
* Job: DispatchScoreJobsJob
*
* Připraví batch scoring jobů a nastaví korektní progress pro krok score.
*/
class DispatchScoreJobsJob implements ShouldQueue
{
use Queueable;
public int $tries = 2;
public array $backoff = [30];
public function __construct(
protected int $evaluationRunId
) {
}
public function handle(): void
{
$run = EvaluationRun::find($this->evaluationRunId);
if (! $run || $run->isCanceled()) {
return;
}
$coordinator = app(EvaluationCoordinator::class);
$coordinator->eventInfo($run, 'Dispatch score: krok spuštěn.', [
'step' => 'dispatch_score',
'round_id' => $run->round_id,
]);
try {
$coordinator->dispatchStep($run, 'score');
$coordinator->eventInfo($run, 'Dispatch score: krok dokončen.', [
'step' => 'dispatch_score',
'round_id' => $run->round_id,
]);
} catch (Throwable $e) {
$coordinator->eventError($run, 'Dispatch score: krok selhal.', [
'step' => 'dispatch_score',
'round_id' => $run->round_id,
'error' => $e->getMessage(),
]);
throw $e;
}
}
}