From 31259fa106100add048443e0f1c9e3d1f28dd29f Mon Sep 17 00:00:00 2001 From: Jeffrey Gelens Date: Sun, 20 May 2012 23:49:08 +0200 Subject: [PATCH] Fixed examples. use_connection is now being used. --- examples/run_example.py | 7 ++----- examples/run_worker.py | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/run_example.py b/examples/run_example.py index d1b273c..5c52ec7 100644 --- a/examples/run_example.py +++ b/examples/run_example.py @@ -1,13 +1,10 @@ import os import time -from rq import Queue +from rq import Queue, use_connection from fib import slow_fib # Tell RQ what Redis connection to use -from redis import Redis -from rq import conn -conn.push(Redis()) - +use_connection() # Range of Fibonacci numbers to compute fib_range = range(20, 34) diff --git a/examples/run_worker.py b/examples/run_worker.py index 4853788..38af522 100644 --- a/examples/run_worker.py +++ b/examples/run_worker.py @@ -1,9 +1,7 @@ -from rq import Queue, Worker +from rq import Queue, Worker, use_connection # Tell rq what Redis connection to use -from redis import Redis -from rq import conn -conn.push(Redis()) +use_connection() if __name__ == '__main__': q = Queue()