fix: log init exceptions
This commit is contained in:
parent
0d4954c01a
commit
60bb556f2c
1 changed files with 13 additions and 9 deletions
|
|
@ -137,19 +137,23 @@ def register_startup(app: FastAPI):
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def lnbits_startup():
|
async def lnbits_startup():
|
||||||
|
|
||||||
# 1. wait till migration is done
|
try:
|
||||||
await migrate_databases()
|
# 1. wait till migration is done
|
||||||
|
await migrate_databases()
|
||||||
|
|
||||||
# 2. setup admin settings
|
# 2. setup admin settings
|
||||||
await check_admin_settings()
|
await check_admin_settings()
|
||||||
|
|
||||||
log_server_info()
|
log_server_info()
|
||||||
|
|
||||||
# 3. initialize WALLET
|
# 3. initialize WALLET
|
||||||
set_wallet_class()
|
set_wallet_class()
|
||||||
|
|
||||||
# 4. initialize funding source
|
# 4. initialize funding source
|
||||||
await check_funding_source()
|
await check_funding_source()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(str(e))
|
||||||
|
raise ImportError("Failed to run 'startup' event.")
|
||||||
|
|
||||||
|
|
||||||
def log_server_info():
|
def log_server_info():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue