diff options
-rw-r--r-- | awx/main/models/schedules.py | 3 | ||||
-rw-r--r-- | awx/main/tests/unit/utils/test_schedule_fast_forward.py | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/awx/main/models/schedules.py b/awx/main/models/schedules.py index 046a08a2e8..051305803c 100644 --- a/awx/main/models/schedules.py +++ b/awx/main/models/schedules.py @@ -64,6 +64,9 @@ def _fast_forward_rrule(rrule, ref_dt=None): if rrule._freq not in {dateutil.rrule.HOURLY, dateutil.rrule.MINUTELY}: return rrule + if rrule._count: + return rrule + if ref_dt is None: ref_dt = now() diff --git a/awx/main/tests/unit/utils/test_schedule_fast_forward.py b/awx/main/tests/unit/utils/test_schedule_fast_forward.py index 48ce4b6612..075e485b07 100644 --- a/awx/main/tests/unit/utils/test_schedule_fast_forward.py +++ b/awx/main/tests/unit/utils/test_schedule_fast_forward.py @@ -115,6 +115,12 @@ def test_future_date_does_not_fast_forward(): assert new_rrule == rrule +def test_rrule_with_count_does_not_fast_forward(): + rrule = dateutil.rrule.rrule(freq=MINUTELY, interval=5, count=1, dtstart=REF_DT) + + assert rrule == _fast_forward_rrule(rrule, ref_dt=REF_DT) + + @pytest.mark.parametrize( ('freq', 'interval'), [ |