Skip to content

Commit

Permalink
Fixes persistent connections when used many databases on the same ins…
Browse files Browse the repository at this point in the history
…tance (#462)
  • Loading branch information
qRoC authored and curry684 committed Oct 15, 2018
1 parent fd24b11 commit 13dee35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Factory/PredisParametersFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public static function create($options, $class, $dsn)
$dsnOptions = static::parseDsn(new RedisDsn($dsn));
$dsnOptions = array_merge($options, $dsnOptions);

if (isset($dsnOptions['persistent'], $dsnOptions['database']) && true === $dsnOptions['persistent']) {
$dsnOptions['persistent'] = (int)$dsnOptions['database'];
}

return new $class($dsnOptions);
}

Expand Down

0 comments on commit 13dee35

Please sign in to comment.