diff --git a/app/controllers/general.php b/app/controllers/general.php index fef58f541b..9c8f8bf815 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -693,6 +693,7 @@ App::error() $publish = $error->getCode() === 0 || $error->getCode() >= 500; } + /* if ($error->getCode() >= 400 && $error->getCode() < 500) { // Register error logger $providerName = App::getEnv('_APP_EXPERIMENT_LOGGING_PROVIDER', ''); @@ -709,6 +710,7 @@ App::error() $publish = true; } } + */ if ($logger && $publish) { try { diff --git a/composer.json b/composer.json index b31f6056b3..753dde70ad 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,8 @@ "utopia-php/migration": "0.4.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.5.*", - "utopia-php/pools": "0.4.*", + "utopia-php/pools": "0.5.*", + "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.7.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.18.*", diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index 31dd124c46..5363df2864 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -7,8 +7,6 @@ use Appwrite\Platform\Tasks\Doctor; use Appwrite\Platform\Tasks\Install; use Appwrite\Platform\Tasks\Maintenance; use Appwrite\Platform\Tasks\Migrate; -use Appwrite\Platform\Tasks\QueueCount; -use Appwrite\Platform\Tasks\QueueRetry; use Appwrite\Platform\Tasks\ScheduleFunctions; use Appwrite\Platform\Tasks\ScheduleMessages; use Appwrite\Platform\Tasks\SDKs; @@ -18,6 +16,8 @@ use Appwrite\Platform\Tasks\Upgrade; use Appwrite\Platform\Tasks\Vars; use Appwrite\Platform\Tasks\Version; use Utopia\Platform\Service; +use Appwrite\Platform\Tasks\QueueRetry; +use Appwrite\Platform\Tasks\QueueCount; class Tasks extends Service { @@ -30,8 +30,6 @@ class Tasks extends Service ->addAction(Install::getName(), new Install()) ->addAction(Maintenance::getName(), new Maintenance()) ->addAction(Migrate::getName(), new Migrate()) - ->addAction(QueueCount::getName(), new QueueCount()) - ->addAction(QueueRetry::getName(), new QueueRetry()) ->addAction(SDKs::getName(), new SDKs()) ->addAction(SSL::getName(), new SSL()) ->addAction(ScheduleFunctions::getName(), new ScheduleFunctions()) @@ -40,6 +38,8 @@ class Tasks extends Service ->addAction(Upgrade::getName(), new Upgrade()) ->addAction(Vars::getName(), new Vars()) ->addAction(Version::getName(), new Version()) + ->addAction(QueueRetry::getName(), new QueueRetry()) + ->addAction(QueueCount::getName(), new QueueCount()) ; } } diff --git a/src/Appwrite/Platform/Tasks/QueueCount.php b/src/Appwrite/Platform/Tasks/QueueCount.php index 961360479d..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,19 +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 - ]), '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 7259f82c89..5cd0a87ff8 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -7,6 +7,8 @@ use Utopia\CLI\Console; 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; @@ -22,19 +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 - ]), '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));