Skip to content
Snippets Groups Projects
Commit ccaa60c3 authored by David Trattnig's avatar David Trattnig
Browse files

fix(clock): fallback event init

parent d8f64c74
No related branches found
No related tags found
1 merge request!35ORM-less scheduling
...@@ -83,6 +83,8 @@ class ClockInfoHandler: ...@@ -83,6 +83,8 @@ class ClockInfoHandler:
Args: Args:
timeslot (Timeslot): The active timeslot, if available. Can be `None`. timeslot (Timeslot): The active timeslot, if available. Can be `None`.
""" """
scheduler: AuraScheduler = self.engine.scheduler
upcoming_timeslots: list[domain.Timeslot] = scheduler.timetable.get_next_timeslots()
# Check if we are within a valid timeslot # Check if we are within a valid timeslot
if timeslot: if timeslot:
...@@ -91,8 +93,6 @@ class ClockInfoHandler: ...@@ -91,8 +93,6 @@ class ClockInfoHandler:
self.logger.info("Fallback activated outsite of timeslot") self.logger.info("Fallback activated outsite of timeslot")
# Interpolate timeslot-less slot (in the future provided by Virtual Timeslots) # Interpolate timeslot-less slot (in the future provided by Virtual Timeslots)
scheduler: AuraScheduler = self.engine.scheduler
upcoming_timeslots: list[domain.Timeslot] = scheduler.timetable.get_next_timeslots()
virtual_start_time = datetime.now() virtual_start_time = datetime.now()
virtual_end_time = virtual_start_time + timedelta(hours=1) virtual_end_time = virtual_start_time + timedelta(hours=1)
if len(upcoming_timeslots) > 0: if len(upcoming_timeslots) > 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment