forked from Dniel97/artemis
aimedb: add enable toggle
This commit is contained in:
parent
a676e42a59
commit
bb752563cc
@ -314,6 +314,12 @@ class AimedbConfig:
|
|||||||
def __init__(self, parent_config: "CoreConfig") -> None:
|
def __init__(self, parent_config: "CoreConfig") -> None:
|
||||||
self.__config = parent_config
|
self.__config = parent_config
|
||||||
|
|
||||||
|
@property
|
||||||
|
def enable(self) -> bool:
|
||||||
|
return CoreConfig.get_config_field(
|
||||||
|
self.__config, "core", "aimedb", "enable", default=True
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def loglevel(self) -> int:
|
def loglevel(self) -> int:
|
||||||
return CoreConfig.str_to_loglevel(
|
return CoreConfig.str_to_loglevel(
|
||||||
|
@ -54,6 +54,7 @@ billing:
|
|||||||
signing_key: "cert/billing.key"
|
signing_key: "cert/billing.key"
|
||||||
|
|
||||||
aimedb:
|
aimedb:
|
||||||
|
enable: True
|
||||||
loglevel: "info"
|
loglevel: "info"
|
||||||
port: 22345
|
port: 22345
|
||||||
key: ""
|
key: ""
|
||||||
|
4
index.py
4
index.py
@ -69,14 +69,16 @@ async def launch_allnet(cfg: CoreConfig) -> None:
|
|||||||
|
|
||||||
|
|
||||||
async def launcher(cfg: CoreConfig, ssl: bool) -> None:
|
async def launcher(cfg: CoreConfig, ssl: bool) -> None:
|
||||||
AimedbServlette(cfg).start()
|
|
||||||
task_list = [asyncio.create_task(launch_main(cfg, ssl))]
|
task_list = [asyncio.create_task(launch_main(cfg, ssl))]
|
||||||
|
|
||||||
if cfg.billing.standalone:
|
if cfg.billing.standalone:
|
||||||
task_list.append(asyncio.create_task(launch_billing(cfg)))
|
task_list.append(asyncio.create_task(launch_billing(cfg)))
|
||||||
if cfg.frontend.enable:
|
if cfg.frontend.enable:
|
||||||
task_list.append(asyncio.create_task(launch_frontend(cfg)))
|
task_list.append(asyncio.create_task(launch_frontend(cfg)))
|
||||||
if cfg.allnet.standalone:
|
if cfg.allnet.standalone:
|
||||||
task_list.append(asyncio.create_task(launch_allnet(cfg)))
|
task_list.append(asyncio.create_task(launch_allnet(cfg)))
|
||||||
|
if cfg.aimedb.enable:
|
||||||
|
AimedbServlette(cfg).start()
|
||||||
|
|
||||||
done, pending = await asyncio.wait(
|
done, pending = await asyncio.wait(
|
||||||
task_list,
|
task_list,
|
||||||
|
Loading…
Reference in New Issue
Block a user