mirror of https://github.com/peter4431/rq.git
Rewrite of the connection setup.
I'd want to advice against using `use_connection()` more, as the connection setup is less explicit, and also pollutes global memory. Because, well: $ python -m this | head -n4 | tail -n1 ;)main
parent
31259fa106
commit
48cee215af
@ -1,8 +1,8 @@
|
|||||||
from rq import Queue, Worker, use_connection
|
from rq import Queue, Worker, Connection
|
||||||
|
|
||||||
# Tell rq what Redis connection to use
|
|
||||||
use_connection()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
# Tell rq what Redis connection to use
|
||||||
|
with Connection():
|
||||||
q = Queue()
|
q = Queue()
|
||||||
Worker(q).work()
|
Worker(q).work()
|
||||||
|
Loading…
Reference in New Issue