review: addressing

This commit is contained in:
Binyamin Yawitz
2024-09-05 18:06:41 -04:00
parent 439e42e1ab
commit 557eefe2c4
5 changed files with 12 additions and 15 deletions
-4
View File
@@ -1026,10 +1026,6 @@ Http::wildcard()
throw new AppwriteException(AppwriteException::GENERAL_ROUTE_NOT_FOUND);
});
foreach (Config::getParam('services', []) as $service) {
//include_once $service['controller'];
}
include_once 'mock.php';
include_once 'shared/api.php';
include_once 'shared/api/auth.php';
+1 -1
View File
@@ -55,7 +55,7 @@ Http::init()
return;
}
if (str_contains($route->getPath(), '/v1/graphql')) { // Skip for graphQL recursive call
if ($route->getLabel('sdk.namespace','') === 'graphql') { // Skip for graphQL recursive call
return;
}
+9 -8
View File
@@ -138,7 +138,7 @@ $server->onStart(function () use ($stats, $container, $containerId, &$statsDocum
sleep(DATABASE_RECONNECT_SLEEP);
}
} while (true);
// TODO NOW $registry->get('pools')->reclaim();
($container->get('connections'))->reclaim();
});
/**
@@ -166,7 +166,8 @@ $server->onStart(function () use ($stats, $container, $containerId, &$statsDocum
} catch (Throwable $th) {
call_user_func($logError, $th, "updateWorkerDocument");
} finally {
// TODO NOW $registry->get('pools')->reclaim();
($container->get('connections'))->reclaim();
$container->refresh('dbForConsole');
}
});
}
@@ -231,7 +232,8 @@ $server->onWorkerStart(function (int $workerId) use ($server, $container, $stats
'data' => $event['data']
]));
}
// TODO NOW $registry->get('pools')->reclaim();
($container->get('connections'))->reclaim();
$container->refresh('dbForConsole');
}
}
/**
@@ -311,7 +313,6 @@ $server->onWorkerStart(function (int $workerId) use ($server, $container, $stats
$realtime->unsubscribe($connection);
$realtime->subscribe($projectId, $connection, $roles, $channels);
//TODO NOW $registry->get('pools')->reclaim();
}
}
@@ -343,8 +344,8 @@ $server->onWorkerStart(function (int $workerId) use ($server, $container, $stats
sleep(DATABASE_RECONNECT_SLEEP);
continue;
} finally {
//$registry->get('pools')->reclaim();
// TODO eldad add connections reclaim
($container->get('connections'))->reclaim();
$container->refresh('dbForConsole');
}
}
@@ -369,7 +370,6 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server,
Console::info("Connection open (user: {$connection})");
try {
$dbForConsole = $container->get('dbForConsole');
/** @var Document $project */
$project = $container->refresh('project')->get('project');
@@ -586,7 +586,8 @@ $server->onMessage(function (int $connection, string $message) use ($server, $co
$server->close($connection, $th->getCode());
}
} finally {
// TODO NOW $registry->get('pools')->reclaim();
($container->get('connections'))->reclaim();
$container->refresh('dbForConsole');
}
});
+1 -1
View File
@@ -104,7 +104,7 @@ $container->set($executionRetention);
$container->set($deviceForLocalFiles);
$platform = new Appwrite();
$args = $_SERVER['argv'];
$args = $platform->getEnv('argv');
if (!isset($args[1])) {
Console::error('Missing worker name');
+1 -1
View File
@@ -46,7 +46,7 @@ class MockNumber extends Validator
return false;
}
$otp = new Text(6, 6, Validator\Text::NUMBERS);
$otp = new Text(6, 6, Text::NUMBERS);
if (!$otp->isValid($value['otp'])) {
$this->message = 'Invalid OTP. Please make sure the OTP is a 6 digit number';
return false;