summaryrefslogtreecommitdiff
path: root/rq/scheduler.py
diff options
context:
space:
mode:
Diffstat (limited to 'rq/scheduler.py')
-rw-r--r--rq/scheduler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rq/scheduler.py b/rq/scheduler.py
index ce5e754..850c1bc 100644
--- a/rq/scheduler.py
+++ b/rq/scheduler.py
@@ -106,7 +106,7 @@ class RQScheduler:
pid = os.getpid()
self.log.info("Trying to acquire locks for %s", ", ".join(self._queue_names))
for name in self._queue_names:
- if self.connection.set(self.get_locking_key(name), pid, nx=True, ex=60):
+ if self.connection.set(self.get_locking_key(name), pid, nx=True, ex=self.interval + 60):
successful_locks.add(name)
# Always reset _scheduled_job_registries when acquiring locks
@@ -186,11 +186,11 @@ class RQScheduler:
with self.connection.pipeline() as pipeline:
for name in self._queue_names:
key = self.get_locking_key(name)
- pipeline.expire(key, self.interval + 5)
+ pipeline.expire(key, self.interval + 60)
pipeline.execute()
else:
key = self.get_locking_key(next(iter(self._queue_names)))
- self.connection.expire(key, self.interval + 5)
+ self.connection.expire(key, self.interval + 60)
def stop(self):
self.log.info("Scheduler stopping, releasing locks for %s...",