Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions octobot/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions octobot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ","
Expand Down