Skip to content

Commit

Permalink
replace -1 with None for max_backoff_delay_seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
amamd07 committed Jan 22, 2025
1 parent 0a762fb commit e43c4dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyworker/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Job(object, metaclass=Meta):
def __init__(self, class_name, database, logger,
job_id, queue, run_at, attempts=0, max_attempts=1,
attributes=None, abstract=False, extra_fields=None,
reporter=None, max_backoff_delay_seconds=-1):
reporter=None, max_backoff_delay_seconds=None):
super(Job, self).__init__()
self.class_name = class_name
self.database = database
Expand Down Expand Up @@ -146,7 +146,7 @@ def set_error_unlock(self, error):
# set new exponential run_at
setters.append('run_at = %s')
delta = (self.attempts**4) + 5
if self.max_backoff_delay_seconds > 0 and delta > self.max_backoff_delay_seconds:
if self.max_backoff_delay_seconds and delta > self.max_backoff_delay_seconds:
delta = self.max_backoff_delay_seconds
values.append(str(now + get_time_delta(seconds=delta)))

Expand Down

0 comments on commit e43c4dd

Please sign in to comment.