Test ogdClient
testing/ogcore-api/pipeline/head This commit looks good
Details
testing/ogcore-api/pipeline/head This commit looks good
Details
parent
4973be6af6
commit
1db829d9ff
|
@ -22,18 +22,10 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
|
|||
#[AsController]
|
||||
class StatusAction extends AbstractController
|
||||
{
|
||||
protected readonly HttpClientInterface $httpClient;
|
||||
|
||||
|
||||
public function __construct(
|
||||
protected readonly EntityManagerInterface $entityManager,
|
||||
)
|
||||
{
|
||||
$this->httpClient = HttpClient::create([
|
||||
'verify_peer' => false,
|
||||
'verify_host' => false,
|
||||
]);
|
||||
}
|
||||
protected readonly HttpClientInterface $httpClient
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws TransportExceptionInterface
|
||||
|
@ -48,8 +40,11 @@ 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,
|
||||
'timeout' => 10,
|
||||
]);
|
||||
$statusCode = $response->getStatusCode();
|
||||
$client->setStatus($statusCode === Response::HTTP_OK ? 'active' : 'off');
|
||||
|
||||
|
|
Loading…
Reference in New Issue