|
|
@ -25,7 +25,6 @@ class Worker(object):
|
|
|
|
self.queues = queues
|
|
|
|
self.queues = queues
|
|
|
|
self.validate_queues()
|
|
|
|
self.validate_queues()
|
|
|
|
self.rv_ttl = rv_ttl
|
|
|
|
self.rv_ttl = rv_ttl
|
|
|
|
self._working = False
|
|
|
|
|
|
|
|
self.log = Logger('worker')
|
|
|
|
self.log = Logger('worker')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,7 +84,6 @@ class Worker(object):
|
|
|
|
self.log = Logger('horse')
|
|
|
|
self.log = Logger('horse')
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.procline('Processing work since %d' % (time.time(),))
|
|
|
|
self.procline('Processing work since %d' % (time.time(),))
|
|
|
|
self._working = True
|
|
|
|
|
|
|
|
self.perform_job(job)
|
|
|
|
self.perform_job(job)
|
|
|
|
except Exception, e:
|
|
|
|
except Exception, e:
|
|
|
|
self.log.exception(e)
|
|
|
|
self.log.exception(e)
|
|
|
@ -94,7 +92,6 @@ class Worker(object):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.procline('Forked %d at %d' % (child_pid, time.time()))
|
|
|
|
self.procline('Forked %d at %d' % (child_pid, time.time()))
|
|
|
|
os.waitpid(child_pid, 0)
|
|
|
|
os.waitpid(child_pid, 0)
|
|
|
|
self._working = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def perform_job(self, job):
|
|
|
|
def perform_job(self, job):
|
|
|
|
self.procline('Processing %s from %s since %s' % (job.func.__name__, job.origin.name, time.time()))
|
|
|
|
self.procline('Processing %s from %s since %s' % (job.func.__name__, job.origin.name, time.time()))
|
|
|
|