addressing comments

This commit is contained in:
shimon
2022-11-02 16:43:42 +02:00
parent 7bd16180c3
commit da5addf2f2
3 changed files with 8 additions and 11 deletions
+2 -2
View File
@@ -84,8 +84,8 @@ _APP_MAINTENANCE_RETENTION_AUDIT=1209600
_APP_USAGE_TIMESERIES_INTERVAL=2
_APP_USAGE_DATABASE_INTERVAL=15
_APP_USAGE_STATS=enabled
_APP_LOGGING_PROVIDER=sentry
_APP_LOGGING_CONFIG=4190483bb7d14d659e526aa61b0c7b5e;4504077395230720
_APP_LOGGING_PROVIDER=
_APP_LOGGING_CONFIG=
_APP_REGION=nyc1
DOCKERHUB_PULL_USERNAME=
DOCKERHUB_PULL_PASSWORD=
+3 -6
View File
@@ -3,17 +3,14 @@
require_once __DIR__ . '/init.php';
use Appwrite\DSN\DSN;
use Appwrite\Extend\Exception;
use Appwrite\URL\URL as AppwriteURL;
use Swoole\Runtime;
use Utopia\App;
use Utopia\Cache\Adapter\Sharding;
use Utopia\Cache\Cache;
use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\Validator\Authorization;
use Utopia\Logger\Log;
use Utopia\Logger\Logger;
use Utopia\Queue\Server;
use Utopia\Registry\Registry;
use Utopia\Queue;
@@ -71,8 +68,8 @@ $fallbackForRedis = AppwriteURL::unparse([
$connection = App::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis);
$dsns = explode(',', $connection ?? '');
if (empty($dsns[0])) {
Console::error("Dsn not found");
if (empty($dsns)) {
throw new Exception(Exception::GENERAL_SERVER_ERROR);
}
$dsn = explode('=', $dsns[0]);
+3 -3
View File
@@ -92,7 +92,7 @@ function handle($dbForConsole, $regions, $stack): void
if ($response['status'] !== Response::STATUS_CODE_OK) {
Console::error("[{$time}] Request to {$code} has failed");
$dbForConsole->createDocument('syncs', new Document([
$dbForConsole->createDocument('sync', new Document([
'region' => App::getEnv('_APP_REGION'),
'target' => $code,
'keys' => $stack,
@@ -103,8 +103,8 @@ function handle($dbForConsole, $regions, $stack): void
}
}
$adapter = new Queue\Adapter\Swoole($redisConnection, $workerNumber, 'syncOut');
$server = new Queue\Server($adapter);
$adapter = new Queue\Adapter\Swoole($redisConnection, $workerNumber, 'syncOut');
$server = new Queue\Server($adapter);
$server->job()
->inject('message')