forked from retoor/devplacepy
update
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from devplacepy.config import DEVII_LESSONS_DB, DEVII_TASKS_DB
|
||||
from devplacepy_services.base.sqlite_broker import SQLiteFileBroker
|
||||
|
||||
_tasks = SQLiteFileBroker("devii_tasks", DEVII_TASKS_DB)
|
||||
_lessons = SQLiteFileBroker("devii_lessons", DEVII_LESSONS_DB)
|
||||
|
||||
|
||||
def broker_for(name: str) -> SQLiteFileBroker:
|
||||
if name == "devii_tasks":
|
||||
return _tasks
|
||||
if name == "devii_lessons":
|
||||
return _lessons
|
||||
raise KeyError(name)
|
||||
|
||||
|
||||
async def startup() -> None:
|
||||
await _tasks.startup()
|
||||
await _lessons.startup()
|
||||
|
||||
|
||||
async def shutdown() -> None:
|
||||
await _tasks.shutdown()
|
||||
await _lessons.shutdown()
|
||||
Reference in New Issue
Block a user