#50 removes redis connection argument from pusher process

This commit is contained in:
Ilan Steemers
2015-08-24 10:08:43 +02:00
parent b414b637eb
commit 3e92fddcdd
3 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -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)