refs #952. First revision status endpoint ogAgent
testing/ogcore-api/pipeline/head Something is wrong with the build of this commit
Details
testing/ogcore-api/pipeline/head Something is wrong with the build of this commit
Details
parent
14ff759309
commit
756bea4844
|
@ -47,9 +47,15 @@ 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');
|
||||||
|
|
||||||
$client->setStatus('active');
|
if ($response->getStatusCode() !== Response::HTTP_OK) {
|
||||||
$this->entityManager->persist($client);
|
$client->setStatus('off');
|
||||||
$this->entityManager->flush();
|
$this->entityManager->persist($client);
|
||||||
|
$this->entityManager->flush();
|
||||||
|
} else if ($response->getStatusCode() === Response::HTTP_OK) {
|
||||||
|
$client->setStatus('active');
|
||||||
|
$this->entityManager->persist($client);
|
||||||
|
$this->entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
} catch (TransportExceptionInterface $e) {
|
} catch (TransportExceptionInterface $e) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue