1
0
Fork 0
mirror of synced 2024-06-26 10:10:57 +12:00

Merge branch 'feat-db-per-process' of github.com:appwrite/appwrite into feat-db-per-process

# Conflicts:
#	bin/worker-databases
#	src/Appwrite/Event/Database.php
#	src/Appwrite/Platform/Workers/Databases.php
This commit is contained in:
Jake Barnby 2023-10-12 15:28:52 +13:00
commit 6f42305484
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
7 changed files with 4 additions and 8 deletions

View file

@ -1110,7 +1110,7 @@ App::put('/v1/account/sessions/magic-url')
->inject('locale')
->inject('geodb')
->inject('queueForEvents')
->action(function (string $userId, string $secret, Request $request, Response $response,Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) {
->action(function (string $userId, string $secret, Request $request, Response $response, Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) {
/** @var Utopia\Database\Document $user */

View file

@ -1680,8 +1680,6 @@ App::post('/v1/functions/:functionId/executions')
$execution->setAttribute('logs', $executionResponse['logs']);
$execution->setAttribute('errors', $executionResponse['errors']);
$execution->setAttribute('duration', $executionResponse['duration']);
} catch (\Throwable $th) {
$durationEnd = \microtime(true);

View file

@ -257,7 +257,7 @@ App::put('/v1/teams/:teamId')
->inject('response')
->inject('dbForProject')
->inject('queueForEvents')
->action(function (string $teamId, string $name, ?\DateTime $requestTimestamp , Response $response, Database $dbForProject, Event $queueForEvents) {
->action(function (string $teamId, string $name, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents) {
$team = $dbForProject->getDocument('teams', $teamId);

View file

@ -130,7 +130,7 @@ App::post('/v1/users')
->inject('project')
->inject('dbForProject')
->inject('queueForEvents')
->action(function (string $userId, ?string $email, ?string $phone, ?string $password, string $name, Response $response,Document $project, Database $dbForProject, Event $queueForEvents) {
->action(function (string $userId, ?string $email, ?string $phone, ?string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents) {
$user = createUser('plaintext', '{}', $userId, $email, $password, $phone, $name, $project, $dbForProject, $queueForEvents);
$response

View file

@ -224,7 +224,7 @@ if (isset($args[0])) {
try {
$platform->init(Service::TYPE_WORKER, [
'workersNum' => strtolower($workerName) === 'databases'? 1 :swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)),
'workersNum' => strtolower($workerName) === 'databases' ? 1 : swoole_cpu_num() * intval(App::getEnv('_APP_WORKER_PER_CORE', 6)),
'connection' => $pools->get('queue')->pop()->getResource(),
'workerName' => strtolower($workerName) ?? null,
]);

View file

@ -19,7 +19,6 @@ class Audit extends Event
$this
->setQueue(Event::AUDITS_QUEUE_NAME)
->setClass(Event::BUILDS_CLASS_NAME);
}
/**

View file

@ -15,7 +15,6 @@ require_once __DIR__ . '/../../../app/init.php';
class EventTest extends TestCase
{
protected ?Event $object = null;
protected string $queue = '';