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 click
import uvicorn import uvicorn
from lnbits.settings import settings, set_cli_settings from lnbits.settings import set_cli_settings, settings
@click.command( @click.command(

View File

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

View File

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

View File

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