From 96413e4840045395a35068f0c4264a70a5c71b5e Mon Sep 17 00:00:00 2001 From: Belissimo_T Date: Mon, 30 Sep 2024 20:20:09 +0200 Subject: [PATCH] fix 6f6f7049 (cherry picked from commit ed6a8383d2a13aaa5f71455a61d91a79912c058f) --- backend/load_plans.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/load_plans.py b/backend/load_plans.py index d47dc0a..6c83e7b 100644 --- a/backend/load_plans.py +++ b/backend/load_plans.py @@ -29,6 +29,7 @@ def __init__(self, school_number: str, plan_downloader: PlanDownloader, plan_pro self.plan_downloader = plan_downloader self.plan_processor = plan_processor self._plan_compute_executor = concurrent.futures.ProcessPoolExecutor(max_workers=1) + self._plan_compute_awaiter_executor = concurrent.futures.ThreadPoolExecutor(max_workers=2) async def check_infinite(self, interval: int = 60, *, once: bool = False, ignore_exceptions: bool = False): try: @@ -61,7 +62,7 @@ def _process_plans(t_start: datetime.datetime): if updated_dates: self.plan_processor._logger.debug("* Processing plans...") self.plan_processor.meta_extractor.invalidate_cache() - self._plan_compute_executor.submit(_process_plans, t_start=_t1) + 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: