refs #2613. Captured busy client status
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
parent
02fd21d38b
commit
9b18d253f3
|
@ -67,6 +67,19 @@ abstract class AbstractOgAgentController extends AbstractController
|
|||
$response = $this->httpClient->request($method, $url, $params);
|
||||
return json_decode($response->getContent(), true);
|
||||
} catch (ClientExceptionInterface | ServerExceptionInterface $e) {
|
||||
if ($e->getResponse() && $e->getResponse()->getStatusCode() === 409) {
|
||||
$this->logger->info('Client is busy (409 Conflict)', [
|
||||
'url' => $url,
|
||||
'status_code' => 409
|
||||
]);
|
||||
|
||||
return [
|
||||
'code' => 409,
|
||||
'message' => 'Client is busy',
|
||||
'details' => $e->getMessage(),
|
||||
];
|
||||
}
|
||||
|
||||
$this->logger->error(sprintf('Client/Server error in request to %s: %s', $url, $e->getMessage()));
|
||||
|
||||
return [
|
||||
|
|
|
@ -39,7 +39,7 @@ class StatusController extends AbstractController
|
|||
{
|
||||
const string CREATE_IMAGE = 'RESPUESTA_CrearImagen';
|
||||
const string CREATE_IMAGE_GIT = 'RESPUESTA_CrearImagenGit';
|
||||
const string UPDATE_IMAGE_GIT = 'RESPUESTA_ActualizarImagenGit';
|
||||
const string UPDATE_IMAGE_GIT = 'RESPUESTA_ModificarImagenGit';
|
||||
const string RESTORE_IMAGE = 'RESPUESTA_RestaurarImagen';
|
||||
const string RESTORE_IMAGE_GIT = 'RESPUESTA_RestaurarImagenGit';
|
||||
const string CONFIGURE_IMAGE = 'RESPUESTA_Configurar';
|
||||
|
|
|
@ -10,6 +10,7 @@ final class TraceStatus
|
|||
public const string FAILED = 'failed';
|
||||
public const string CANCELLED = 'cancelled';
|
||||
public const string SENT = 'sent';
|
||||
public const string BUSY = 'busy';
|
||||
|
||||
private const array STATUS = [
|
||||
self::PENDING => 'Pendiente',
|
||||
|
@ -18,6 +19,7 @@ final class TraceStatus
|
|||
self::FAILED => 'Fallido',
|
||||
self::CANCELLED => 'Cancelado',
|
||||
self::SENT => 'Enviado',
|
||||
self::BUSY => 'Ocupado',
|
||||
];
|
||||
|
||||
public static function getStatus(): array
|
||||
|
|
|
@ -15,7 +15,7 @@ readonly class CreateService
|
|||
{
|
||||
}
|
||||
|
||||
public function __invoke(?Client $client = null, ?string $command, string $status, ?string $jobId = '', ?array $input = []): Trace
|
||||
public function __invoke(?Client $client = null, ?string $command, string $status, ?string $jobId = '', ?array $input = [], ?string $output = null): Trace
|
||||
{
|
||||
$trace = new Trace();
|
||||
$trace->setClient($client);
|
||||
|
@ -24,6 +24,7 @@ readonly class CreateService
|
|||
$trace->setJobId($jobId);
|
||||
$trace->setExecutedAt(new \DateTime());
|
||||
$trace->setInput($input);
|
||||
$trace->setOutput($output);
|
||||
|
||||
$this->entityManager->persist($trace);
|
||||
$this->entityManager->flush();
|
||||
|
|
Loading…
Reference in New Issue