From 2729b5435f7afc23f6a0e8062568f03ac990a9c6 Mon Sep 17 00:00:00 2001 From: Craig Slusher Date: Wed, 30 May 2012 15:40:00 -0400 Subject: [PATCH] Uses push_connection() and pop_connection() --- rq/connections.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rq/connections.py b/rq/connections.py index eb5d197..7aa7cf7 100644 --- a/rq/connections.py +++ b/rq/connections.py @@ -11,11 +11,11 @@ class NoRedisConnectionException(Exception): def Connection(connection=None): if connection is None: connection = Redis() - _connection_stack.push(connection) + push_connection(connection) try: yield finally: - popped = _connection_stack.pop() + popped = pop_connection() assert popped == connection, \ 'Unexpected Redis connection was popped off the stack. ' \ 'Check your Redis connection setup.' @@ -41,7 +41,7 @@ def use_connection(redis=None): if redis is None: redis = Redis() - _connection_stack.push(redis) + push_connection(redis) def get_current_connection():