diff --git a/octobot/commands.py b/octobot/commands.py index 8811a6eb5..af31b5655 100644 --- a/octobot/commands.py +++ b/octobot/commands.py @@ -135,24 +135,25 @@ async def update_or_repair_tentacles_if_necessary(community_auth, selected_profi elif force_refresh_tentacles_setup_config: community_tentacles_packages.refresh_tentacles_setup_config() - if local_profile_tentacles_setup_config is None or \ - not tentacles_manager_api.are_tentacles_up_to_date(local_profile_tentacles_setup_config, constants.VERSION): - logger.info("OctoBot tentacles are not up to date. Updating tentacles...") - _check_tentacles_install_exit() - if await install_or_update_tentacles(config, to_install_urls, False): - logger.info("OctoBot tentacles are now up to date.") - else: - if to_install_urls: - logger.debug("Installing new tentacles.") - # install additional tentacles only when tentacles arch is valid. Install all tentacles otherwise - only_additional = tentacles_manager_api.is_tentacles_architecture_valid() - await install_or_update_tentacles(config, to_install_urls, only_additional) - if tentacles_manager_api.load_tentacles(verbose=True): - logger.debug("OctoBot tentacles are up to date.") - else: - logger.info("OctoBot tentacles are damaged. Installing default tentacles only ...") + if constants.SHOULD_CHECK_TENTACLES: + if local_profile_tentacles_setup_config is None or \ + not tentacles_manager_api.are_tentacles_up_to_date(local_profile_tentacles_setup_config, constants.VERSION): + logger.info("OctoBot tentacles are not up to date. Updating tentacles...") _check_tentacles_install_exit() - await install_or_update_tentacles(config, [], False) + if await install_or_update_tentacles(config, to_install_urls, False): + logger.info("OctoBot tentacles are now up to date.") + else: + if to_install_urls: + logger.debug("Installing new tentacles.") + # install additional tentacles only when tentacles arch is valid. Install all tentacles otherwise + only_additional = tentacles_manager_api.is_tentacles_architecture_valid() + await install_or_update_tentacles(config, to_install_urls, only_additional) + if tentacles_manager_api.load_tentacles(verbose=True): + logger.debug("OctoBot tentacles are up to date.") + else: + logger.info("OctoBot tentacles are damaged. Installing default tentacles only ...") + _check_tentacles_install_exit() + await install_or_update_tentacles(config, [], False) async def install_or_update_tentacles( diff --git a/octobot/constants.py b/octobot/constants.py index 2a3bf5d38..02e85a678 100644 --- a/octobot/constants.py +++ b/octobot/constants.py @@ -127,6 +127,7 @@ IS_DEMO = os_util.parse_boolean_environment_var("IS_DEMO", "False") IS_CLOUD_ENV = os_util.parse_boolean_environment_var("IS_CLOUD_ENV", "false") USE_FETCHED_BOT_CONFIG = os_util.parse_boolean_environment_var("USE_FETCHED_BOT_CONFIG", "false") +SHOULD_CHECK_TENTACLES = os_util.parse_boolean_environment_var("SHOULD_CHECK_TENTACLES", "true") CAN_INSTALL_TENTACLES = os_util.parse_boolean_environment_var("CAN_INSTALL_TENTACLES", str(not IS_CLOUD_ENV)) PH_TRACKING_ID = os.getenv("PH_TRACKING_ID", "phc_QSuFy6zqOXXKT7zAYboYS4nJShfKovpB172aa8X9nXf") # Profiles download urls to import at startup if missing, split by ","