Skip to content

Commit 2f9c764

Browse files
authored
Fix recurrence (#71)
Recurrence didn't properly work as we passed in the empty list for the by-* fiedls by default which means "No valid time-unit", e.g bymonth=[] means no month at all. never.
2 parents bee57c0 + bd751ca commit 2f9c764

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Summary
44

5-
* `frequenz-sdk` dependency has been extended to include version `1.0.0-rc1000`.
5+
This is a hot fix for recurrence not working

src/frequenz/dispatch/_dispatch.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,14 @@ def _prepare_rrule(self) -> rrule.rrule:
222222
dtstart=self.start_time,
223223
count=count,
224224
until=until,
225-
byminute=self.recurrence.byminutes,
226-
byhour=self.recurrence.byhours,
225+
byminute=self.recurrence.byminutes or None,
226+
byhour=self.recurrence.byhours or None,
227227
byweekday=[
228228
_RRULE_WEEKDAY_MAP[weekday] for weekday in self.recurrence.byweekdays
229-
],
230-
bymonthday=self.recurrence.bymonthdays,
231-
bymonth=self.recurrence.bymonths,
229+
]
230+
or None,
231+
bymonthday=self.recurrence.bymonthdays or None,
232+
bymonth=self.recurrence.bymonths or None,
232233
interval=self.recurrence.interval,
233234
)
234235

0 commit comments

Comments
 (0)