mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
fix mod condition
This commit is contained in:
parent
d1deef43c5
commit
453ce03881
1 changed files with 3 additions and 2 deletions
|
|
@ -124,7 +124,7 @@ App::post('/v1/projects')
|
|||
|
||||
$databaseOverride = App::getEnv('_APP_DATABASE_OVERRIDE', null);
|
||||
$index = array_search($databaseOverride, $databases);
|
||||
if ($index) {
|
||||
if ($index !== false) {
|
||||
$database = $databases[$index];
|
||||
} else {
|
||||
$database = $databases[array_rand($databases)];
|
||||
|
|
@ -177,7 +177,8 @@ App::post('/v1/projects')
|
|||
$mod = 20;
|
||||
$index = array_search('database_db_fra1_self_hosted_0_0', $databases);
|
||||
if ($index !== false && ($project->getInternalId() % $mod === 0)) {
|
||||
$project->setAttribute('database', $databases[$index]);
|
||||
$database = $databases[$index];
|
||||
$project->setAttribute('database', $database);
|
||||
$dbForConsole->updateDocument('projects', $project);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue