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()