Skip to content

Commit

Permalink
optimize reset redis database
Browse files Browse the repository at this point in the history
  • Loading branch information
hhxsv5 committed Mar 10, 2020
1 parent 21d5678 commit 80340a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Connectors/CoroutineRedisConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public function reset($connection, array $config)
{
/**@var Redis $connection */
$connection->setDefer(false);
$connection->select($config['database'] ?? 0);
if (isset($config['database'])) {
$connection->select($config['database']);
}
}

public function validate($connection): bool
Expand Down

0 comments on commit 80340a9

Please sign in to comment.