mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Not importing configs unless WROLPi config was imported, and WROL mode is disabled.
This commit is contained in:
parent
d7691fba71
commit
db956faedf
1 changed files with 25 additions and 18 deletions
43
main.py
43
main.py
|
|
@ -224,24 +224,31 @@ async def start_single_tasks(app: Sanic):
|
|||
with suppress(Exception):
|
||||
get_wrolpi_config().import_config()
|
||||
logger.debug('wrolpi config imported')
|
||||
with suppress(Exception):
|
||||
tags.import_tags_config()
|
||||
logger.debug('tags config imported')
|
||||
with suppress(Exception):
|
||||
get_videos_downloader_config().import_config()
|
||||
logger.debug('videos downloader config imported')
|
||||
with suppress(Exception):
|
||||
await import_downloads_config()
|
||||
logger.debug('downloads config imported')
|
||||
# Channels uses both downloads and tags.
|
||||
with suppress(Exception):
|
||||
import_channels_config()
|
||||
logger.debug('channels config imported')
|
||||
with suppress(Exception):
|
||||
import_inventories_config()
|
||||
logger.debug('inventories config imported')
|
||||
with suppress(Exception):
|
||||
init_inventory()
|
||||
|
||||
wrolpi_config = get_wrolpi_config()
|
||||
if wrolpi_config.successful_import:
|
||||
# Only import other configs if WROLPi config was imported, and WROL mode is not enabled.
|
||||
if wrolpi_config.wrol_mode:
|
||||
logger.warning('Refusing to import other configs when WROL mode is enabled!')
|
||||
else:
|
||||
with suppress(Exception):
|
||||
tags.import_tags_config()
|
||||
logger.debug('tags config imported')
|
||||
with suppress(Exception):
|
||||
get_videos_downloader_config().import_config()
|
||||
logger.debug('videos downloader config imported')
|
||||
with suppress(Exception):
|
||||
await import_downloads_config()
|
||||
logger.debug('downloads config imported')
|
||||
# Channels uses both downloads and tags.
|
||||
with suppress(Exception):
|
||||
import_channels_config()
|
||||
logger.debug('channels config imported')
|
||||
with suppress(Exception):
|
||||
import_inventories_config()
|
||||
logger.debug('inventories config imported')
|
||||
with suppress(Exception):
|
||||
init_inventory()
|
||||
|
||||
from modules.zim.lib import flag_outdated_zim_files
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue