Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
(cherry picked from commit 29f227a)
  • Loading branch information
Belissimo-T committed Nov 4, 2024
1 parent 96413e4 commit 60b8851
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions backend/load_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,35 @@ async def check_infinite(self, interval: int = 60, *, once: bool = False, ignore
updated_dates = await self.plan_downloader.update_fetch()

def _process_plans(t_start: datetime.datetime):
self._plan_compute_executor.map(
self.plan_processor.update_day_plans, updated_dates
)
self.plan_processor.update_after_plan_processing()
events.submit_event(
events.PlanCrawlCycle(
school_number=self.school_number,
start_time=t_start,
end_time=events.now(),
try:
self._plan_compute_executor.map(
self.plan_processor.update_day_plans, updated_dates
)
)
self.plan_processor.update_after_plan_processing()
events.submit_event(
events.PlanCrawlCycle(
school_number=self.school_number,
start_time=t_start,
end_time=events.now(),
)
)
except Exception:
if not ignore_exceptions:
raise
else:
self.plan_processor._logger.error("An error occurred (_process_plans).", exc_info=True)

if updated_dates:
self.plan_processor._logger.debug("* Processing plans...")
self.plan_processor.meta_extractor.invalidate_cache()
self._plan_compute_awaiter_executor.submit(_process_plans, t_start=_t1)
else:
self.plan_processor._logger.debug("* No plans to process.")
except Exception as e:
except Exception:
if not ignore_exceptions:
raise
else:
self.plan_processor._logger.error("An error occurred.", exc_info=e)
self.plan_processor._logger.error("An error occurred.", exc_info=True)

if once:
break
Expand Down

0 comments on commit 60b8851

Please sign in to comment.