1
0
Fork 0
mirror of synced 2024-09-20 11:37:45 +12:00

get project db key by region

This commit is contained in:
shimon 2024-08-06 21:44:37 +03:00
parent a60c441d41
commit 81b7f2273f
2 changed files with 7 additions and 0 deletions

View file

@ -133,6 +133,7 @@ App::post('/v1/projects')
}
var_dump([
'location' => 'Api::projects',
'_APP_DATABASE_SHARED_TABLES' => System::getEnv('_APP_DATABASE_SHARED_TABLES', ''),
'region' => $region,
'dsn' => $dsn,

View file

@ -1365,6 +1365,12 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForConsole,
->setMetadata('project', $project->getId())
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS);
var_dump([
'location' => 'Init::getProjectDB',
'_APP_DATABASE_SHARED_TABLES' => System::getEnv('_APP_DATABASE_SHARED_TABLES', ''),
'dsn' => $dsn,
]);
$sharedTablesKeys = explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
if (in_array($dsn->getHost(), $sharedTablesKeys)) {
$database