summaryrefslogtreecommitdiff
path: root/apscheduler
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2018-01-03 22:25:57 +0200
committerAlex Grönholm <alex.gronholm@nextday.fi>2018-01-03 22:25:57 +0200
commit01dcea45ade6962f9f2aee8a552f7be39dc40af3 (patch)
tree0cbe806171bd5b32db9e221275e7600997d559a1 /apscheduler
parentc385f948e9f5b4004023bca5cc19a40f3a19af75 (diff)
downloadapscheduler-01dcea45ade6962f9f2aee8a552f7be39dc40af3.tar.gz
Fixed CronTrigger with jitter producing fire times beyond end_date
Fixes #269.
Diffstat (limited to 'apscheduler')
-rw-r--r--apscheduler/triggers/cron/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/apscheduler/triggers/cron/__init__.py b/apscheduler/triggers/cron/__init__.py
index e10f893..ce675dd 100644
--- a/apscheduler/triggers/cron/__init__.py
+++ b/apscheduler/triggers/cron/__init__.py
@@ -192,9 +192,8 @@ class CronTrigger(BaseTrigger):
return None
if fieldnum >= 0:
- if self.jitter is not None:
- next_date = self._apply_jitter(next_date, self.jitter, now)
- return next_date
+ next_date = self._apply_jitter(next_date, self.jitter, now)
+ return min(next_date, self.end_date) if self.end_date else next_date
def __getstate__(self):
return {