ソースを参照

Attempt to fix linter

jrobinAV 1 年間 前
コミット
dce2160517

+ 1 - 0
taipy/core/_orchestrator/_dispatcher/_job_dispatcher.py

@@ -66,6 +66,7 @@ class _JobDispatcher(threading.Thread):
             except Exception as e:
                 _TaipyLogger._get_logger().exception(e)
                 pass
+        self._logger.info("Job dispatcher stopped.")
 
     def _can_execute(self) -> bool:
         """Returns True if the dispatcher have resources to execute a new job."""

+ 1 - 7
taipy/core/_orchestrator/_dispatcher/_standalone_job_dispatcher.py

@@ -36,10 +36,7 @@ class _StandaloneJobDispatcher(_JobDispatcher):
     def run(self):
         with self._executor:
             super().run()
-            # TODO REMOVE THIS
-            self._logger.info("Thread is stopped")
-        # TODO REMOVE THIS
-        self._logger.info("Executor is closed")
+        self._logger.info("Standalone job dispatcher: Pool executor shut down")
 
     def _dispatch(self, job: Job):
         """Dispatches the given `Job^` on an available worker for execution.
@@ -50,9 +47,6 @@ class _StandaloneJobDispatcher(_JobDispatcher):
 
         self._nb_available_workers -= 1
         config_as_string = _TomlSerializer()._serialize(Config._applied_config)  # type: ignore[attr-defined]
-        # TODO REMOVE THIS
-        if self._executor._shutdown_thread:  # type: ignore
-            self._logger.info(f"{job.id=}, {job.task.id=} is not dispatched because executor is closed.")
         future = self._executor.submit(_TaskFunctionWrapper(job.id, job.task), config_as_string=config_as_string)
 
         self._set_dispatched_processes(job.id, future)  # type: ignore