Change the max_instances for the workers to only allow one parallel job execution.

This commit is contained in:
Jake Moshenko 2014-10-22 18:09:00 -04:00
parent ea96dbb2ad
commit 1ccd6a9c5d

View file

@ -171,9 +171,11 @@ class Worker(object):
self._sched.start()
self._sched.add_job(self.poll_queue, 'interval', seconds=self._poll_period_seconds,
start_date=soon)
self._sched.add_job(self.update_queue_metrics, 'interval', seconds=60, start_date=soon)
self._sched.add_job(self.run_watchdog, 'interval', seconds=self._watchdog_period_seconds)
start_date=soon, max_instances=1)
self._sched.add_job(self.update_queue_metrics, 'interval', seconds=60, start_date=soon,
max_instances=1)
self._sched.add_job(self.run_watchdog, 'interval', seconds=self._watchdog_period_seconds,
max_instances=1)
signal.signal(signal.SIGTERM, self.terminate)
signal.signal(signal.SIGINT, self.terminate)