summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rq/worker.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rq/worker.py b/rq/worker.py
index 810fbab..946995e 100644
--- a/rq/worker.py
+++ b/rq/worker.py
@@ -699,8 +699,9 @@ class Worker(object):
started_job_registry.remove(job, pipeline=pipeline)
self.set_current_job_id(None, pipeline=pipeline)
self.increment_failed_job_count(pipeline)
- self.increment_total_working_time(job.ended_at - job.started_at,
- pipeline)
+ if job.started_at and job.ended_at:
+ self.increment_total_working_time(job.ended_at - job.started_at,
+ pipeline)
try:
pipeline.execute()