|
|
|
@ -100,8 +100,8 @@ class Worker(object):
|
|
|
|
|
return worker
|
|
|
|
|
|
|
|
|
|
def __init__(self, queues, name=None,
|
|
|
|
|
default_result_ttl=DEFAULT_RESULT_TTL, connection=None,
|
|
|
|
|
exc_handler=None, default_worker_ttl=DEFAULT_WORKER_TTL): # noqa
|
|
|
|
|
default_result_ttl=None, connection=None,
|
|
|
|
|
exc_handler=None, default_worker_ttl=None): # noqa
|
|
|
|
|
if connection is None:
|
|
|
|
|
connection = get_current_connection()
|
|
|
|
|
self.connection = connection
|
|
|
|
@ -111,8 +111,15 @@ class Worker(object):
|
|
|
|
|
self.queues = queues
|
|
|
|
|
self.validate_queues()
|
|
|
|
|
self._exc_handlers = []
|
|
|
|
|
|
|
|
|
|
if default_result_ttl is None:
|
|
|
|
|
default_result_ttl = DEFAULT_RESULT_TTL
|
|
|
|
|
self.default_result_ttl = default_result_ttl
|
|
|
|
|
|
|
|
|
|
if default_worker_ttl is None:
|
|
|
|
|
default_worker_ttl = DEFAULT_WORKER_TTL
|
|
|
|
|
self.default_worker_ttl = default_worker_ttl
|
|
|
|
|
|
|
|
|
|
self._state = 'starting'
|
|
|
|
|
self._is_horse = False
|
|
|
|
|
self._horse_pid = 0
|
|
|
|
|