1
0
Fork 0
mirror of synced 2024-10-02 02:07:04 +13:00

fix mod condition

This commit is contained in:
shimon 2023-10-23 11:22:28 +03:00
parent b09a254d3c
commit 2ef8490691

View file

@ -101,9 +101,9 @@ App::post('/v1/projects')
$databases = Config::getParam('pools-database', []);
$databaseSelfHosted = 'database_db_fra1_self_hosted_0_0';
$SelfHostedIndex = array_search($databaseSelfHosted, $databases);
if ($SelfHostedIndex !== false) {
unset($databases[$SelfHostedIndex]);
$selfHostedIndex = array_search($databaseSelfHosted, $databases);
if ($selfHostedIndex !== false) {
unset($databases[$selfHostedIndex]);
}
/**
@ -179,7 +179,7 @@ App::post('/v1/projects')
* Update database with self-managed db every $mod projects
*/
$mod = 20;
if ($project->getInternalId() % $mod === 0 && $SelfHostedIndex !== false) {
if ($project->getInternalId() % $mod === 0 && $selfHostedIndex !== false) {
$project->setAttribute('database', $databaseSelfHosted);
$dbForConsole->updateDocument('projects', $project);
}