init::pools replica addition

This commit is contained in:
shimon
2023-08-09 10:14:26 +03:00
parent 3a38b492f5
commit e5f841e353
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -532,6 +532,12 @@ $register->set('pools', function () {
'multiple' => true,
'schemes' => ['mariadb', 'mysql'],
],
'replica' => [
'type' => 'database',
'dsns' => App::getEnv('_APP_CONNECTIONS_DB_REPLICAS', $fallbackForDB),
'multiple' => true,
'schemes' => ['mysql'],
],
'queue' => [
'type' => 'queue',
'dsns' => App::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis),
+1 -1
View File
@@ -65,7 +65,7 @@ class Backup extends Action
try {
$attempts++;
$pools
->get('database_' . $database)
->get('replica_' . $database)
->pop()
->getResource();