Converting Tag methods to use tag id or name.

This commit is contained in:
Roland 2024-07-30 17:15:01 -06:00
parent 2ad363281f
commit c839acb270
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
22 changed files with 379 additions and 163 deletions

28
main.py
View file

@ -244,16 +244,24 @@ async def start_single_tasks(app: Sanic):
download_manager.retry_downloads()
# Hotspot/throttle are not supported in Docker containers.
if not DOCKERIZED and get_wrolpi_config().hotspot_on_startup:
try:
admin.enable_hotspot()
except Exception as e:
logger.error('Failed to enable hotspot', exc_info=e)
if not DOCKERIZED and get_wrolpi_config().throttle_on_startup:
try:
admin.throttle_cpu_on()
except Exception as e:
logger.error('Failed to throttle CPU', exc_info=e)
if not DOCKERIZED:
if get_wrolpi_config().hotspot_on_startup:
logger.info('Starting hotspot...')
try:
admin.enable_hotspot()
except Exception as e:
logger.error('Failed to enable hotspot', exc_info=e)
else:
logger.info('Hotspot on startup is disabled.')
if get_wrolpi_config().throttle_on_startup:
logger.info('Throttling CPU...')
try:
admin.throttle_cpu_on()
except Exception as e:
logger.error('Failed to throttle CPU', exc_info=e)
else:
logger.info('CPU throttle on startup is disabled')
# Run the startup functions
for func in BEFORE_STARTUP_FUNCTIONS: