Skip to content

Commit

Permalink
Make logs consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinAV committed Mar 8, 2024
1 parent bdbaf83 commit 704a524
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions taipy/core/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def run(self, force_restart=False):
self.__class__._is_running = True

self._manage_version_and_block_config()
self.__logger.info("Core service started.")
self.__start_dispatcher(force_restart)
self.__logger.info("Core service has been started.")

def stop(self, wait: bool = True, timeout: Optional[float] = None):
"""
Expand All @@ -73,18 +73,17 @@ def stop(self, wait: bool = True, timeout: Optional[float] = None):
wait (bool): If True, the method will wait for the dispatcher to stop.
timeout (Optional[float]): The maximum time to wait. If None, the method will wait indefinitely.
"""
self.__logger.info("Unblocking configuration update.")
self.__logger.info("Unblocking configuration update...")
Config.unblock_update()

self.__logger.info("Stopping job dispatcher...")
if self._dispatcher:
self._dispatcher = _OrchestratorFactory._remove_dispatcher(wait, timeout)
self.__logger.info("Core service has been stopped.")

with self.__class__.__lock_is_running:
self.__class__._is_running = False

with self.__class__.__lock_version_is_initialized:
self.__class__._version_is_initialized = False
self.__logger.info("Core service has been stopped.")

@classmethod
def _manage_version_and_block_config(cls):
Expand All @@ -103,24 +102,28 @@ def _manage_version_and_block_config(cls):

@classmethod
def __update_core_section(cls):
cls.__logger.info("Updating configuration with command-line arguments...")
_CoreCLI.create_parser()
Config._applied_config._unique_sections[CoreSection.name]._update(_CoreCLI.parse_arguments())

@classmethod
def __manage_version(cls):
cls.__logger.info("Managing application's version...")
_VersionManagerFactory._build_manager()._manage_version()
Config._applied_config._unique_sections[CoreSection.name]._update(
{"version_number": _VersionManagerFactory._build_manager()._get_latest_version()}
)

@classmethod
def __check_and_block_config(cls):
cls.__logger.info("Checking application's version...")
Config.check()
cls.__logger.info("Blocking configuration update.")
cls.__logger.info("Blocking configuration update...")
Config.block_update()
_init_backup_file_with_storage_folder()

def __start_dispatcher(self, force_restart):
self.__logger.info("Starting job dispatcher...")
if self._orchestrator is None:
self._orchestrator = _OrchestratorFactory._build_orchestrator()

Expand Down

0 comments on commit 704a524

Please sign in to comment.