mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 20:08:13 +08:00
#50 removes redis connection argument from pusher process
This commit is contained in:
+3
-2
@@ -165,7 +165,7 @@ class Sentinel(object):
|
||||
return p
|
||||
|
||||
def spawn_pusher(self):
|
||||
return self.spawn_process(pusher, self.task_queue, self.event_out, self.list_key, self.r)
|
||||
return self.spawn_process(pusher, self.task_queue, self.event_out, self.list_key)
|
||||
|
||||
def spawn_worker(self):
|
||||
self.spawn_process(worker, self.task_queue, self.result_queue, Value('f', -1), self.timeout)
|
||||
@@ -287,7 +287,7 @@ class Sentinel(object):
|
||||
Stat(self).save()
|
||||
|
||||
|
||||
def pusher(task_queue, event, list_key=Conf.Q_LIST, r=redis_client):
|
||||
def pusher(task_queue, event, list_key=Conf.Q_LIST):
|
||||
"""
|
||||
Pulls tasks of the Redis List and puts them in the task queue
|
||||
:type task_queue: multiprocessing.Queue
|
||||
@@ -295,6 +295,7 @@ def pusher(task_queue, event, list_key=Conf.Q_LIST, r=redis_client):
|
||||
:type list_key: str
|
||||
"""
|
||||
logger.info(_('{} pushing tasks at {}').format(current_process().name, current_process().pid))
|
||||
r = redis_client
|
||||
while True:
|
||||
try:
|
||||
task = r.blpop(list_key, 1)
|
||||
|
||||
Reference in New Issue
Block a user