From 5ead82f57c02f2946360361082c5f4db6753f292 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 5 Oct 2020 20:32:52 -0300 Subject: [PATCH] fix /lnurlwallet again. db.commit() and wait 3 seconds. should finally fix https://github.com/lnbits/lnbits/issues/103 --- lnbits/core/views/generic.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lnbits/core/views/generic.py b/lnbits/core/views/generic.py index 9ea4592..46fa31b 100644 --- a/lnbits/core/views/generic.py +++ b/lnbits/core/views/generic.py @@ -1,3 +1,4 @@ +import trio # type: ignore import httpx from os import path from http import HTTPStatus @@ -122,7 +123,11 @@ async def lnurlwallet(): account = create_account() user = get_user(account.id) wallet = create_wallet(user_id=user.id) + g.db.commit() - run_on_pseudo_request(redeem_lnurl_withdraw, wallet.id, withdraw_res, "LNbits initial funding: voucher redeem.") + await run_on_pseudo_request( + redeem_lnurl_withdraw, wallet.id, withdraw_res, "LNbits initial funding: voucher redeem." + ) + await trio.sleep(3) return redirect(url_for("core.wallet", usr=user.id, wal=wallet.id))