1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00

Fix functions worker crash

This commit is contained in:
Jake Barnby 2023-08-23 15:08:26 -04:00
parent 06ba381b57
commit 0a5b0fa06b
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 4 additions and 2 deletions

View file

@ -14,6 +14,7 @@ use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Validator\Authorization;
use Utopia\Queue\Adapter\Swoole;
use Utopia\Queue\Message;
use Utopia\Queue\Server;
@ -107,7 +108,7 @@ $connection = $pools->get('queue')->pop()->getResource();
$workerNumber = swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6));
if (empty(App::getEnv('QUEUE'))) {
throw new Exception('Please configure "QUEUE" environemnt variable.');
throw new Exception('Please configure "QUEUE" environment variable.');
}
$adapter = new Swoole($connection, $workerNumber, App::getEnv('QUEUE'));
@ -145,7 +146,7 @@ $server
$log->addExtra('line', $error->getLine());
$log->addExtra('trace', $error->getTraceAsString());
$log->addExtra('detailedTrace', $error->getTrace());
$log->addExtra('roles', \Utopia\Database\Validator\Authorization::$roles);
$log->addExtra('roles', Authorization::getRoles());
$isProduction = App::getEnv('_APP_ENV', 'development') === 'production';
$log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING);

View file

@ -465,6 +465,7 @@ services:
- openruntimes-executor
environment:
- _APP_ENV
- _APP_WORKER_PER_CORE
- _APP_OPENSSL_KEY_V1
- _APP_REDIS_HOST
- _APP_REDIS_PORT