Update frozen deps and paramaterize the config file
This commit is contained in:
parent
fef0818535
commit
696b420ed3
3 changed files with 64 additions and 11 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
from typing import Any, Dict, List, Optional, Protocol, Tuple, cast
|
||||
|
||||
import uvicorn
|
||||
|
|
@ -38,7 +39,8 @@ async def matrix_main(matrix_client: MatrixClient) -> None:
|
|||
|
||||
@app.on_event("startup")
|
||||
async def startup_event() -> None:
|
||||
bot_settings = load_config()
|
||||
config_fname = os.environ.get("BOT_CONFIG_FILE", "config.yaml")
|
||||
bot_settings = load_config(config_fname)
|
||||
c = MatrixClient(settings=bot_settings.matrix, join_rooms=bot_settings.get_rooms())
|
||||
app.state.matrix_client = c
|
||||
app.state.bot_settings = bot_settings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue