From 0d5127d90b2b3da9909a6f980bd4980ad0185905 Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 23 Oct 2023 00:08:55 +0300 Subject: [PATCH] fix mod condition --- app/controllers/api/projects.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index eb657c116d..6f2f4f40e3 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -175,7 +175,8 @@ App::post('/v1/projects') * Update database with self-managed db every $mod projects */ $mod = 20; - if ($index = array_search('database_db_fra1_self_hosted_0_0', $databases) && $project->getInternalId() % $mod === 0) { + $index = array_search('database_db_fra1_self_hosted_0_0', $databases); + if ($index !== false && ($project->getInternalId() % $mod === 0)) { $project->setAttribute('database', $databases[$index]); $dbForConsole->updateDocument('projects', $project); }