diff --git a/rq_scheduler/scheduler.py b/rq_scheduler/scheduler.py index 78bab4e..eee030a 100644 --- a/rq_scheduler/scheduler.py +++ b/rq_scheduler/scheduler.py @@ -20,7 +20,7 @@ class Scheduler(object): scheduler_key = 'rq:scheduler' scheduled_jobs_key = 'rq:scheduler:scheduled_jobs' - def __init__(self, queue_name='default', interval=60, connection=None): + def __init__(self, queue_name='default', interval=60, connection=None, scheduler_key=None, scheduled_jobs_key=None): from rq.connections import resolve_connection self.connection = resolve_connection(connection) self.queue_name = queue_name @@ -28,6 +28,12 @@ def __init__(self, queue_name='default', interval=60, connection=None): self.log = logger self._lock_acquired = False + if scheduler_key: + self.scheduler_key = scheduler_key + + if scheduled_jobs_key: + self.scheduled_jobs_key = scheduled_jobs_key + def register_birth(self): if self.connection.exists(self.scheduler_key) and \ not self.connection.hexists(self.scheduler_key, 'death'):