Apply suggestions from code review
Co-authored-by: Christy Jacob <christyjacob4@gmail.com>
This commit is contained in:
parent
5d373e1ce7
commit
77d6ea8890
|
@ -355,15 +355,15 @@ App::get('/v1/health/anti-virus')
|
|||
(int) App::getEnv('_APP_STORAGE_ANTIVIRUS_PORT', 3310));
|
||||
|
||||
try {
|
||||
$output['version'] = @$antiVirus->version();
|
||||
$output['status'] = (@$antiVirus->ping()) ? 'pass' : 'fail';
|
||||
$output['version'] = @$antivirus->version();
|
||||
$output['status'] = (@$antivirus->ping()) ? 'pass' : 'fail';
|
||||
} catch( \Exception $e) {
|
||||
$output['status'] = 'offline';
|
||||
$output['version'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$response->dynamic(new Document($output), Response::MODEL_HEALTH_STATUS);
|
||||
$response->dynamic(new Document($output), Response::MODEL_HEALTH_ANTIVIRUS);
|
||||
});
|
||||
|
||||
App::get('/v1/health/stats') // Currently only used internally
|
||||
|
|
|
@ -5,20 +5,20 @@ namespace Appwrite\Utopia\Response\Model;
|
|||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class HealthAntiVirus extends Model
|
||||
class HealthAntivirus extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->addRule('version', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'AntiVirus version.',
|
||||
'description' => 'Antivirus version.',
|
||||
'default' => '',
|
||||
'example' => '1.0.0',
|
||||
])
|
||||
->addRule('status', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'AntiVirus status. Possible values can are: `disabled`, `offline`, `online`',
|
||||
'description' => 'Antivirus status. Possible values can are: `disabled`, `offline`, `online`',
|
||||
'default' => '',
|
||||
'example' => 'online',
|
||||
])
|
||||
|
@ -32,11 +32,11 @@ class HealthAntiVirus extends Model
|
|||
*/
|
||||
public function getName():string
|
||||
{
|
||||
return 'Health AntiVirus';
|
||||
return 'Health Antivirus';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Collection
|
||||
* Get Type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -10,7 +10,7 @@ class HealthStatus extends Model
|
|||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->addRule('checkTime', [
|
||||
->addRule('ping', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Duration in milliseconds how long the health check took.',
|
||||
'default' => 0,
|
||||
|
|
|
@ -10,13 +10,13 @@ class HealthTime extends Model
|
|||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->addRule('remote', [
|
||||
->addRule('remoteTime', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Current unix timestamp on trustful remote server.',
|
||||
'default' => 0,
|
||||
'example' => 1639490751,
|
||||
])
|
||||
->addRule('local', [
|
||||
->addRule('localTime', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Current unix timestamp of local server where Appwrite runs.',
|
||||
'default' => 0,
|
||||
|
|
|
@ -30,7 +30,7 @@ class HealthVersion extends Model
|
|||
}
|
||||
|
||||
/**
|
||||
* Get Collection
|
||||
* Get Type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue