From 2e245a7b4e1a34c6b11ffbf971b75c1d00df8865 Mon Sep 17 00:00:00 2001 From: Zach Kanzler Date: Mon, 24 Feb 2020 19:04:11 -0500 Subject: [PATCH] Respect timeout -1 in worker hard kill (#1187) --- rq/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rq/worker.py b/rq/worker.py index 92e63b4..8c89709 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -688,7 +688,7 @@ class Worker(object): self.heartbeat(self.job_monitoring_interval + 5) # Kill the job from this side if something is really wrong (interpreter lock/etc). - if (utcnow() - job.started_at).total_seconds() > (job.timeout + 1): + if job.timeout != -1 and (utcnow() - job.started_at).total_seconds() > (job.timeout + 1): self.kill_horse() break