Fixed bugs
testing/ogcore-api/pipeline/head This commit looks good Details

pull/12/head
Manuel Aranda Rosales 2024-10-23 10:08:41 +02:00
parent e9619575ae
commit 436c297b73
1 changed files with 5 additions and 14 deletions

View File

@ -25,20 +25,8 @@ class StatusAction extends AbstractController
public function __construct(
protected readonly EntityManagerInterface $entityManager,
protected readonly HttpClientInterface $httpClient
)
{
$httpClient = HttpClient::create([
'verify_peer' => false,
'verify_host' => false,
]);
}
) {}
/**
* @throws TransportExceptionInterface
* @throws ServerExceptionInterface
* @throws RedirectionExceptionInterface
* @throws ClientExceptionInterface
*/
public function __invoke(Client $client): JsonResponse
{
if (!$client->getIp()) {
@ -46,7 +34,10 @@ class StatusAction extends AbstractController
}
try {
$response = $this->httpClient->request('POST', 'https://' . $client->getIp() . ':8000/ogAdmClient/status');
$response = $this->httpClient->request('POST', 'https://' . $client->getIp() . ':8000/ogAdmClient/status', [
'verify_peer' => false,
'verify_host' => false,
]);
$statusCode = $response->getStatusCode();
$client->setStatus($statusCode === Response::HTTP_OK ? 'active' : 'off');