Skip to content

Commit

Permalink
make sure max_backoff_delay_seconds is 2 or more seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
amamd07 committed Jan 22, 2025
1 parent e097d5b commit 4dd767b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyworker/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def __init__(self, class_name, database, logger,
self.job_id = job_id
self.job_name = '%s#run' % class_name
self.attempts = attempts
if max_backoff_delay_seconds:
max_backoff_delay_seconds = max(max_backoff_delay_seconds, 2) # max_backoff_delay_seconds can not be less than 2 seconds
self.max_backoff_delay_seconds = max_backoff_delay_seconds
self.run_at = run_at
self.queue = queue
Expand Down

0 comments on commit 4dd767b

Please sign in to comment.