formatting and conftest

This commit is contained in:
dni ⚡ 2022-10-03 23:41:04 +02:00
parent d2c216d6db
commit 36f54ff0c3
4 changed files with 5 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import time
import click
import uvicorn
from lnbits.settings import settings, set_cli_settings
from lnbits.settings import set_cli_settings, settings
@click.command(

View File

@ -151,10 +151,12 @@ if not settings.lnbits_admin_ui:
for key, value in settings.dict(exclude_none=True).items():
logger.debug(f"{key}: {value}")
def set_cli_settings(**kwargs):
for key, value in kwargs.items():
setattr(settings, key, value)
async def check_admin_settings():
if settings.lnbits_admin_ui:
try:

View File

@ -28,7 +28,7 @@ def app(event_loop):
# use redefined version of the event loop for scope="session"
# loop = asyncio.get_event_loop()
loop = event_loop
#loop.run_until_complete(migrate_databases())
loop.run_until_complete(migrate_databases())
yield app
# # get the current event loop and gracefully stop any running tasks
# loop = event_loop

View File

@ -4,6 +4,7 @@ import sqlite3
from typing import List
import psycopg2
from lnbits.settings import settings
# Python script to migrate an LNbits SQLite DB to Postgres