3
2
forked from Dniel97/artemis

aimedb: add enable toggle

This commit is contained in:
Hay1tsme 2024-01-11 12:25:35 -05:00
parent a676e42a59
commit bb752563cc
3 changed files with 10 additions and 1 deletions

View File

@ -314,6 +314,12 @@ class AimedbConfig:
def __init__(self, parent_config: "CoreConfig") -> None:
self.__config = parent_config
@property
def enable(self) -> bool:
return CoreConfig.get_config_field(
self.__config, "core", "aimedb", "enable", default=True
)
@property
def loglevel(self) -> int:
return CoreConfig.str_to_loglevel(

View File

@ -54,6 +54,7 @@ billing:
signing_key: "cert/billing.key"
aimedb:
enable: True
loglevel: "info"
port: 22345
key: ""

View File

@ -69,14 +69,16 @@ async def launch_allnet(cfg: CoreConfig) -> None:
async def launcher(cfg: CoreConfig, ssl: bool) -> None:
AimedbServlette(cfg).start()
task_list = [asyncio.create_task(launch_main(cfg, ssl))]
if cfg.billing.standalone:
task_list.append(asyncio.create_task(launch_billing(cfg)))
if cfg.frontend.enable:
task_list.append(asyncio.create_task(launch_frontend(cfg)))
if cfg.allnet.standalone:
task_list.append(asyncio.create_task(launch_allnet(cfg)))
if cfg.aimedb.enable:
AimedbServlette(cfg).start()
done, pending = await asyncio.wait(
task_list,