From 877048f91a2eaff0307ee1f27d071cc4576ad689 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 6 Aug 2024 11:17:29 +0300 Subject: [PATCH] get project db key by region --- app/controllers/api/projects.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 0e19bb7976..e07080e345 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -123,7 +123,6 @@ App::post('/v1/projects') $databases = array_filter($databases, function ($value) use ($region) { return str_contains($value, $region); }); - } $dsn = $databases[array_rand($databases)]; @@ -141,7 +140,7 @@ App::post('/v1/projects') // TODO: Temporary until all projects are using shared tables. $sharedTablesKeys = explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); - if (in_array($dsn->getHost(), $sharedTablesKeys)) { + if (in_array($dsn, $sharedTablesKeys)) { $schema = 'appwrite'; $database = 'appwrite'; $namespace = System::getEnv('_APP_DATABASE_SHARED_NAMESPACE', '');