From eb0e2e9d802007445a310635ae1c7fe459e2b404 Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 9 Feb 2023 10:27:38 -0700 Subject: [PATCH] Restoring before startup function accidental commit. --- main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 6370799f..c4cf8b69 100755 --- a/main.py +++ b/main.py @@ -7,7 +7,7 @@ import sys from sanic import Sanic from sanic.signals import Event -from wrolpi import flags +from wrolpi import flags, BEFORE_STARTUP_FUNCTIONS from wrolpi import root_api, admin from wrolpi.common import logger, get_config, import_modules, check_media_directory, limit_concurrent, \ wrol_mode_enabled, cancel_refresh_tasks @@ -138,13 +138,13 @@ def main(): # Import the API in every module. Each API should attach itself to `root_api`. import_modules() - # # Run the startup functions - # for func in BEFORE_STARTUP_FUNCTIONS: - # try: - # logger.debug(f'Calling {func} before startup.') - # func() - # except Exception as e: - # logger.warning(f'Startup {func} failed!', exc_info=e) + # Run the startup functions + for func in BEFORE_STARTUP_FUNCTIONS: + try: + logger.debug(f'Calling {func} before startup.') + func() + except Exception as e: + logger.warning(f'Startup {func} failed!', exc_info=e) # Run the API. if args.sub_commands == 'api':