refs #2591. new response. Added job_id
testing/ogcore-api/pipeline/head There was a failure building this commit Details
ogcore-debian-package/pipeline/head This commit looks good Details
ogcore-debian-package/pipeline/tag This commit looks good Details

develop 0.17.2
Manuel Aranda Rosales 2025-08-04 11:00:29 +02:00
parent 49d09e1952
commit 3c78984217
2 changed files with 4 additions and 16 deletions

View File

@ -127,21 +127,9 @@ class PartitionAssistantAction extends AbstractOgAgentController
$this->entityManager->persist($client);
$this->entityManager->flush();
<<<<<<< Updated upstream
$this->createService->__invoke($client, CommandTypes::PARTITION_AND_FORMAT, TraceStatus::IN_PROGRESS, $jobId, $data);
=======
if ($existingTrace) {
$existingTrace->setStatus(TraceStatus::IN_PROGRESS);
$existingTrace->setJobId($jobId);
$existingTrace->setInput($data);
$this->entityManager->persist($existingTrace);
$this->entityManager->flush();
} else {
$this->createService->__invoke($client, CommandTypes::PARTITION_AND_FORMAT, TraceStatus::IN_PROGRESS, $jobId, $data);
}
$clientJobs['/clients/' . $client->getUuid()] = $jobId;
>>>>>>> Stashed changes
}
}

View File

@ -32,6 +32,8 @@ class RunScriptAction extends AbstractOgAgentController
*/
public function __invoke(CommandExecuteInput $input): JsonResponse
{
$clientJobs = [];
/** @var Client $clientEntity */
foreach ($input->clients as $clientEntity) {
/** @var Client $client */
@ -73,10 +75,8 @@ class RunScriptAction extends AbstractOgAgentController
$this->logger->info('Powering off client', ['client' => $client->getId()]);
$jobId = $response['job_id'];
<<<<<<< Updated upstream
=======
$clientJobs[(string) '/clients/' . $client->getUuid()] = $jobId;
>>>>>>> Stashed changes
$this->entityManager->persist($client);
$this->entityManager->flush();
@ -88,6 +88,6 @@ class RunScriptAction extends AbstractOgAgentController
$this->createService->__invoke($client, CommandTypes::RUN_SCRIPT, TraceStatus::IN_PROGRESS, $jobId, $inputData);
}
return new JsonResponse(data: [], status: Response::HTTP_OK);
return new JsonResponse(data: $clientJobs, status: Response::HTTP_OK);
}
}