mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 20:06:22 -05:00
Converting Tag methods to use tag id or name.
This commit is contained in:
parent
2ad363281f
commit
c839acb270
22 changed files with 379 additions and 163 deletions
28
main.py
28
main.py
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue