get project db key by region
This commit is contained in:
parent
6d961d0789
commit
998a017781
1 changed files with 5 additions and 0 deletions
|
@ -119,6 +119,11 @@ App::post('/v1/projects')
|
||||||
if ($index !== false) {
|
if ($index !== false) {
|
||||||
$dsn = $databases[$index];
|
$dsn = $databases[$index];
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
$databases = array_filter($databases, function($value, $region) {
|
||||||
|
return str_contains($value, $region);
|
||||||
|
});
|
||||||
|
|
||||||
$dsn = $databases[array_rand($databases)];
|
$dsn = $databases[array_rand($databases)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue