Fixed bugs
testing/ogcore-api/pipeline/head This commit looks good
Details
testing/ogcore-api/pipeline/head This commit looks good
Details
parent
e9619575ae
commit
436c297b73
|
@ -25,20 +25,8 @@ class StatusAction extends AbstractController
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected readonly EntityManagerInterface $entityManager,
|
protected readonly EntityManagerInterface $entityManager,
|
||||||
protected readonly HttpClientInterface $httpClient
|
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
|
public function __invoke(Client $client): JsonResponse
|
||||||
{
|
{
|
||||||
if (!$client->getIp()) {
|
if (!$client->getIp()) {
|
||||||
|
@ -46,7 +34,10 @@ class StatusAction extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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();
|
$statusCode = $response->getStatusCode();
|
||||||
$client->setStatus($statusCode === Response::HTTP_OK ? 'active' : 'off');
|
$client->setStatus($statusCode === Response::HTTP_OK ? 'active' : 'off');
|
||||||
|
|
Loading…
Reference in New Issue