diff options
-rw-r--r-- | redis/client.py | 5 | ||||
-rw-r--r-- | redis/connection.py | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/redis/client.py b/redis/client.py index a87e082..601965f 100644 --- a/redis/client.py +++ b/redis/client.py @@ -216,8 +216,9 @@ class Redis(object): #### COMMAND EXECUTION AND PROTOCOL PARSING #### def execute_command(self, *args, **options): "Execute a command and return a parsed response" + pool = self.connection_pool command_name = args[0] - connection = self.connection_pool.get_connection(command_name) + connection = pool.get_connection(command_name, **options) try: connection.send_command(*args) return self.parse_response(connection, command_name, **options) @@ -226,7 +227,7 @@ class Redis(object): connection.send_command(*args) return self.parse_response(connection, command_name, **options) finally: - self.connection_pool.release(connection) + pool.release(connection) def parse_response(self, connection, command_name, **options): "Parses a response from the Redis server" diff --git a/redis/connection.py b/redis/connection.py index 061ee3a..5d6e036 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -250,7 +250,7 @@ class ConnectionPool(object): self._available_connections = [] self._in_use_connections = set() - def get_connection(self, command_name, *keys): + def get_connection(self, command_name, *keys, **options): "Get a connection from the pool" try: connection = self._available_connections.pop() |