1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	app/controllers/api/projects.php
This commit is contained in:
shimon 2023-10-23 01:08:04 +03:00
commit 76e2b39c1a

View file

@ -100,7 +100,11 @@ App::post('/v1/projects')
$backups['database_db_fra1_v14x_07'] = ['from' => '00:00', 'to' => '02:00'];
$databases = Config::getParam('pools-database', []);
$databaseSelfHosted = 'database_db_fra1_self_hosted_0_0';
$index = array_search($databaseSelfHosted, $databases);
if ($index !== false) {
unset($databases[$index]);
}
/**
* Remove databases from the list that are currently undergoing an backup
@ -175,10 +179,9 @@ App::post('/v1/projects')
* Update database with self-managed db every $mod projects
*/
$mod = 20;
$index = array_search('database_db_fra1_self_hosted_0_0', $databases);
if ($index !== false && ($project->getInternalId() % $mod === 0)) {
$database = $databases[$index];
$project->setAttribute('database', $database);
$index = in_array($databaseSelfHosted, $databases);
if ($project->getInternalId() % $mod === 0 && $index !== false) {
$project->setAttribute('database', $databaseSelfHosted);
$dbForConsole->updateDocument('projects', $project);
}