Skip to content

Commit ab13025

Browse files
committed
fix for #755
1 parent 8d44039 commit ab13025

File tree

4 files changed

+1
-36
lines changed

4 files changed

+1
-36
lines changed

README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,18 +1218,7 @@ NB: Any non-error response will have status: 200 OK
12181218

12191219
## Status
12201220

1221-
To connect to your monitoring there are two endpoints, one is up:
1222-
1223-
GET /status/up
1224-
1225-
And this should return status 200 and as data:
1226-
1227-
{
1228-
"db": true,
1229-
"cache": true
1230-
}
1231-
1232-
Values will be false when reading takes longer than 1 second. Alternatively you can use:
1221+
To connect to your monitoring there is a 'ping' endpoint:
12331222

12341223
GET /status/ping
12351224

src/Tqdev/PhpCrudApi/Controller/StatusController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,12 @@ class StatusController
1616

1717
public function __construct(Router $router, Responder $responder, Cache $cache, GenericDB $db)
1818
{
19-
$router->register('GET', '/status/up', array($this, 'up'));
2019
$router->register('GET', '/status/ping', array($this, 'ping'));
2120
$this->db = $db;
2221
$this->cache = $cache;
2322
$this->responder = $responder;
2423
}
2524

26-
public function up(ServerRequestInterface $request): ResponseInterface
27-
{
28-
$result = [
29-
'db' => $this->db->ping()<1000000,
30-
'cache' => $this->cache->ping()<1000000,
31-
];
32-
return $this->responder->success($result);
33-
}
34-
3525
public function ping(ServerRequestInterface $request): ResponseInterface
3626
{
3727
$result = [

src/Tqdev/PhpCrudApi/OpenApi/OpenApiStatusBuilder.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class OpenApiStatusBuilder
99
private $openapi;
1010
private $operations = [
1111
'status' => [
12-
'up' => 'get',
1312
'ping' => 'get',
1413
],
1514
];
@@ -62,11 +61,6 @@ private function setComponentSchema() /*: void*/
6261
$this->openapi->set("$prefix|properties|cache|type", 'integer');
6362
$this->openapi->set("$prefix|properties|cache|format", "int64");
6463
break;
65-
case 'up':
66-
$this->openapi->set("$prefix|required", ['db', 'cache']);
67-
$this->openapi->set("$prefix|properties|db|type", 'boolean');
68-
$this->openapi->set("$prefix|properties|cache|type", 'boolean');
69-
break;
7064
}
7165
}
7266
}

tests/functional/005_status/001_up.log

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)