mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Only create databases for current region
This commit is contained in:
parent
0e03842173
commit
928590b175
1 changed files with 7 additions and 1 deletions
|
|
@ -264,9 +264,15 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg
|
|||
$sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', ''));
|
||||
$sharedTablesV2 = \array_diff($sharedTables, $sharedTablesV1);
|
||||
|
||||
$region = System::getEnv('_APP_REGION', 'fra');
|
||||
$cache = $app->getResource('cache');
|
||||
|
||||
foreach ($sharedTablesV2 as $hostname) {
|
||||
$regionDatabases = \array_filter(
|
||||
$sharedTablesV2,
|
||||
fn ($hostname) => \str_contains($hostname, $region)
|
||||
);
|
||||
|
||||
foreach ($regionDatabases as $hostname) {
|
||||
$adapter = $pools
|
||||
->get($hostname)
|
||||
->pop()
|
||||
|
|
|
|||
Loading…
Reference in a new issue