feat: hack for multi region

This commit is contained in:
Christy Jacob 2024-11-12 18:00:38 +01:00
parent dad8f597ca
commit 900f64bf8d

View file

@ -136,6 +136,16 @@ App::post('/v1/projects')
$dsn = $databases[array_rand($databases)];
}
$dsns = [
'fra' => 'database_db_fra1_self_hosted_0_0',
'syd' => 'database_db_syd1_self_hosted_0_0',
'nyc' => 'database_db_nyc1_self_hosted_0_0',
];
if (isset($dsns[$region])) {
$dsn = $dsns[$region];
}
// TODO: Temporary until all projects are using shared tables.
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));