diff --git a/src/Appwrite/Platform/Tasks/QueueCount.php b/src/Appwrite/Platform/Tasks/QueueCount.php index 9b7bba82d1..97fd602037 100644 --- a/src/Appwrite/Platform/Tasks/QueueCount.php +++ b/src/Appwrite/Platform/Tasks/QueueCount.php @@ -7,6 +7,7 @@ use Utopia\CLI\Console; use Utopia\Platform\Action; use Utopia\Queue\Client; use Utopia\Queue\Connection; +use Utopia\Validator\Text; use Utopia\Validator\WhiteList; class QueueCount extends Action @@ -21,20 +22,7 @@ class QueueCount extends Action { $this ->desc('Return the number of from a specific queue identified by the name parameter with a specific type') - ->param('name', '', new WhiteList([ - Event::DATABASE_QUEUE_NAME, - Event::DELETE_QUEUE_NAME, - Event::AUDITS_QUEUE_NAME, - Event::MAILS_QUEUE_NAME, - Event::FUNCTIONS_QUEUE_NAME, - Event::USAGE_QUEUE_NAME, - Event::WEBHOOK_QUEUE_NAME, - Event::CERTIFICATES_QUEUE_NAME, - Event::BUILDS_QUEUE_NAME, - Event::MESSAGING_QUEUE_NAME, - Event::MIGRATIONS_QUEUE_NAME, - Event::HAMSTER_QUEUE_NAME - ]), 'Queue name') + ->param('name', '', new Text(100), 'Queue name') ->param('type', '', new WhiteList([ 'success', 'failed', diff --git a/src/Appwrite/Platform/Tasks/QueueRetry.php b/src/Appwrite/Platform/Tasks/QueueRetry.php index 2781d9a3f7..5cd0a87ff8 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -8,6 +8,7 @@ use Utopia\Platform\Action; use Utopia\Queue\Client; use Utopia\Queue\Connection; use Utopia\Validator\Integer; +use Utopia\Validator\Text; use Utopia\Validator\WhiteList; use Utopia\Validator\Wildcard; @@ -23,20 +24,7 @@ class QueueRetry extends Action { $this ->desc('Retry failed jobs from a specific queue identified by the name parameter') - ->param('name', '', new WhiteList([ - Event::DATABASE_QUEUE_NAME, - Event::DELETE_QUEUE_NAME, - Event::AUDITS_QUEUE_NAME, - Event::MAILS_QUEUE_NAME, - Event::FUNCTIONS_QUEUE_NAME, - Event::USAGE_QUEUE_NAME, - Event::WEBHOOK_CLASS_NAME, - Event::CERTIFICATES_QUEUE_NAME, - Event::BUILDS_QUEUE_NAME, - Event::MESSAGING_QUEUE_NAME, - Event::MIGRATIONS_QUEUE_NAME, - Event::HAMSTER_CLASS_NAME - ]), 'Queue name') + ->param('name', '', new Text(100), 'Queue name') ->param('limit', 0, new Wildcard(), 'jobs limit', true) ->inject('queue') ->callback(fn ($name, $limit, $queue) => $this->action($name, $limit, $queue));