From cf32ba0351b9cfd77820970fdccbc7a7067e180d Mon Sep 17 00:00:00 2001 From: shimon Date: Sun, 27 Oct 2024 18:10:30 +0200 Subject: [PATCH] debug --- app/controllers/api/projects.php | 4 ---- src/Appwrite/Event/Event.php | 3 ++- src/Appwrite/Platform/Workers/Certificates.php | 1 - src/Appwrite/Platform/Workers/Databases.php | 4 +++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index c8c3928ebc..f051bd6b96 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -123,7 +123,6 @@ App::post('/v1/projects') } $databases = Config::getParam('pools-database', []); - var_dump($databases); $databaseOverride = System::getEnv('_APP_DATABASE_OVERRIDE'); $index = \array_search($databaseOverride, $databases); if ($index !== false) { @@ -198,9 +197,6 @@ App::post('/v1/projects') $dsn = new DSN('mysql://' . $dsn); } - - var_dump($dsn->getHost()); - $adapter = $pools->get($dsn->getHost())->pop()->getResource(); $dbForProject = new Database($adapter, $cache); $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 468b30e7a9..9445ea4129 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -115,7 +115,8 @@ class Event public function getSourceRegion(): string { - return System::getEnv('_APP_REGION', 'default'); + var_dump('event Source Region='.System::getEnv('_APP_REGION')); + return System::getEnv('_APP_REGION'); } /** diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 2261912551..dcc42a87fc 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -174,7 +174,6 @@ class Certificates extends Action $logs = 'Certificate successfully generated.'; $certificate->setAttribute('logs', \mb_strcut($logs, 0, 1000000));// Limit to 1MB - var_dump($certificate); // Give certificates to Traefik $this->applyCertificateFiles($folder, $domain->get(), $letsEncryptData); diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index c9023318c7..c1d185ca06 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -17,6 +17,7 @@ use Utopia\Database\Query; use Utopia\Logger\Log; use Utopia\Platform\Action; use Utopia\Queue\Message; +use Utopia\System\System; class Databases extends Action { @@ -67,7 +68,7 @@ class Databases extends Action $collection = new Document($payload['collection'] ?? []); $document = new Document($payload['document'] ?? []); $database = new Document($payload['database'] ?? []); - $this->sourceRegion = $payload['sourceRegion'] ?? 'default'; + $this->sourceRegion = $payload['sourceRegion'] ?? null; $log->addTag('projectId', $project->getId()); $log->addTag('type', $type); @@ -618,6 +619,7 @@ class Databases extends Action array $events, callable $realtimeConnection ): void { + var_dump('Send region='.$this->sourceRegion); $target = Realtime::fromPayload( // Pass first, most verbose event pattern event: $events[0],