mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Remove HealthFailedJobs Model
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -712,14 +712,14 @@ App::get('/v1/health/queue/failed/:name')
|
||||
->label('sdk.description', '/docs/references/health/get-failed-queue-jobs.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_FAILED_JOBS)
|
||||
->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE)
|
||||
->inject('response')
|
||||
->inject('queue')
|
||||
->action(function (string $queueName, Response $response, Connection $queue) {
|
||||
$client = new Client($queueName, $queue);
|
||||
$failed = $client->countFailedJobs();
|
||||
|
||||
$response->dynamic(new Document(['failed' => $failed]), Response::MODEL_HEALTH_FAILED_JOBS);
|
||||
$response->dynamic(new Document(['size' => $failed]), Response::MODEL_HEALTH_QUEUE);
|
||||
});
|
||||
|
||||
App::get('/v1/health/stats') // Currently only used internally
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Returns the amount of failed jobs in a given queue.
|
||||
@@ -70,7 +70,6 @@ use Appwrite\Utopia\Response\Model\Token;
|
||||
use Appwrite\Utopia\Response\Model\Webhook;
|
||||
use Appwrite\Utopia\Response\Model\Preferences;
|
||||
use Appwrite\Utopia\Response\Model\HealthAntivirus;
|
||||
use Appwrite\Utopia\Response\Model\HealthFailedJobs;
|
||||
use Appwrite\Utopia\Response\Model\HealthQueue;
|
||||
use Appwrite\Utopia\Response\Model\HealthStatus;
|
||||
use Appwrite\Utopia\Response\Model\HealthTime;
|
||||
@@ -255,7 +254,6 @@ class Response extends SwooleResponse
|
||||
public const MODEL_HEALTH_TIME = 'healthTime';
|
||||
public const MODEL_HEALTH_ANTIVIRUS = 'healthAntivirus';
|
||||
public const MODEL_HEALTH_STATUS_LIST = 'healthStatusList';
|
||||
public const MODEL_HEALTH_FAILED_JOBS = 'healthFailedJobs';
|
||||
|
||||
// Console
|
||||
public const MODEL_CONSOLE_VARIABLES = 'consoleVariables';
|
||||
@@ -394,7 +392,6 @@ class Response extends SwooleResponse
|
||||
->setModel(new HealthStatus())
|
||||
->setModel(new HealthTime())
|
||||
->setModel(new HealthVersion())
|
||||
->setModel(new HealthFailedJobs())
|
||||
->setModel(new Metric())
|
||||
->setModel(new MetricBreakdown())
|
||||
->setModel(new UsageDatabases())
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class HealthFailedJobs extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->addRule('failed', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Number of failed jobs in the queue',
|
||||
'default' => '',
|
||||
'example' => '0.15.0',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return 'Health Failed Jobs';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): string
|
||||
{
|
||||
return Response::MODEL_HEALTH_FAILED_JOBS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user