1
0
Fork 0
mirror of synced 2024-07-05 14:40:42 +12:00

Merge pull request #5708 from appwrite/chore-update-database-config

feat: update database config
This commit is contained in:
Christy Jacob 2023-06-15 20:57:21 +05:30 committed by GitHub
commit 72e9ddd3f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,6 +94,7 @@ App::post('/v1/projects')
$backups['database_db_fra1_02'] = ['from' => '7:30', 'to' => '8:15'];
$backups['database_db_fra1_03'] = ['from' => '10:30', 'to' => '11:15'];
$backups['database_db_fra1_04'] = ['from' => '13:30', 'to' => '14:15'];
$backups['database_db_fra1_05'] = ['from' => '4:30', 'to' => '5:15'];
$databases = Config::getParam('pools-database', []);
@ -117,7 +118,11 @@ App::post('/v1/projects')
}
}
$database = $databases[array_rand($databases)];
if ($index = array_search('database_db_fra1_05', $databases)) {
$database = $databases[$index];
} else {
$database = $databases[array_rand($databases)];
}
if ($projectId === 'console') {
throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project.");