Log job requests
This commit is contained in:
@ -3,6 +3,7 @@ namespace Incoviba\Command;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use DateTimeZone;
|
||||
use Psr\Http\Client\ClientExceptionInterface;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console;
|
||||
@ -58,7 +59,12 @@ class Queue extends Command
|
||||
{
|
||||
$uri = "/api/queue/run/{$job_id}";
|
||||
$output->writeln("GET {$uri}");
|
||||
$response = $this->client->get($uri);
|
||||
try {
|
||||
$response = $this->client->get($uri);
|
||||
} catch (ClientExceptionInterface $exception) {
|
||||
$this->logger->error($exception->getMessage());
|
||||
return Console\Command\Command::FAILURE;
|
||||
}
|
||||
$output->writeln("Response Code: {$response->getStatusCode()}");
|
||||
|
||||
return ((int) floor($response->getStatusCode() / 100) === 2) ? Console\Command\Command::SUCCESS : Console\Command\Command::FAILURE;
|
||||
|
Reference in New Issue
Block a user