1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Merge pull request #6984 from appwrite/fix-db-mod

fix mod condition
This commit is contained in:
Christy Jacob 2023-10-23 01:11:05 +04:00 committed by GitHub
commit d1deef43c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}