cleanup and info to user on startup
This commit is contained in:
parent
08e54de99b
commit
1adfb674cc
1 changed files with 2 additions and 3 deletions
|
|
@ -113,13 +113,11 @@ def create_app(config_object="lnbits.settings") -> FastAPI:
|
||||||
def check_settings(app: FastAPI):
|
def check_settings(app: FastAPI):
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def check_settings_admin():
|
async def check_settings_admin():
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
admin_set = await get_admin_settings()
|
admin_set = await get_admin_settings()
|
||||||
if admin_set :
|
if admin_set :
|
||||||
print(f"Access admin user account at: http://{lnbits.settings.HOST}:{lnbits.settings.PORT}/wallet?usr={admin_set.user}")
|
|
||||||
break
|
break
|
||||||
print("ERROR:", admin_set)
|
print("Waiting for admin settings... retrying in 5 seconds!")
|
||||||
await asyncio.sleep(5)
|
await asyncio.sleep(5)
|
||||||
|
|
||||||
admin_set.admin_users = removeEmptyString(admin_set.admin_users.split(','))
|
admin_set.admin_users = removeEmptyString(admin_set.admin_users.split(','))
|
||||||
|
|
@ -129,6 +127,7 @@ def check_settings(app: FastAPI):
|
||||||
admin_set.theme = removeEmptyString(admin_set.theme.split(','))
|
admin_set.theme = removeEmptyString(admin_set.theme.split(','))
|
||||||
admin_set.ad_space = removeEmptyString(admin_set.ad_space.split(','))
|
admin_set.ad_space = removeEmptyString(admin_set.ad_space.split(','))
|
||||||
g().admin_conf = conf.copy(update=admin_set.dict())
|
g().admin_conf = conf.copy(update=admin_set.dict())
|
||||||
|
print(f" ✔️ Access admin user account at: http://{lnbits.settings.HOST}:{lnbits.settings.PORT}/wallet?usr={admin_set.user}")
|
||||||
|
|
||||||
def check_funding_source(app: FastAPI) -> None:
|
def check_funding_source(app: FastAPI) -> None:
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue