fix(webhook): restaurar gestion de progreso y corregir error de sintaxis
ogcore-debian-package/pipeline/head This commit looks good Details
testing/ogcore-api/pipeline/head There was a failure building this commit Details

pull/125/head
Juan Manuel Bardallo 2026-07-20 11:25:50 +02:00
parent f2566bb9c9
commit f08f3f6ff9
1 changed files with 11 additions and 4 deletions

View File

@ -112,12 +112,18 @@ class StatusController extends AbstractController
$this->entityManager->flush();
}
$nfn = $data['nfn'] ?? null;
if (!$nfn) {
return new JsonResponse(data: 'Webhook finished', status: Response::HTTP_OK);
if (isset($data['progress'])){
$trace = $this->entityManager->getRepository(Trace::class)->findOneBy(['jobId' => $data['job_id']]);
if ($trace){
$trace->setProgress((int)($data['progress'] * 100));
$this->entityManager->persist($trace);
$this->entityManager->flush();
}
}
switch ($nfn) {
$nfn = $data['nfn'] ?? null;
if ($nfn) {
switch ($nfn) {
case 'START_SCRIPT':
$trace = $this->entityManager->getRepository(Trace::class)->findOneBy(['jobId' => $data['job_id']]);
if (!$trace) {
@ -408,6 +414,7 @@ class StatusController extends AbstractController
}
}
break;
}
}
return new JsonResponse(data: 'Webhook finished', status: Response::HTTP_OK);