fix: startup of lntickets listeners

This commit is contained in:
Stefan Stammberger
2021-09-29 20:44:00 +02:00
parent f827d2ce18
commit 534dfdb4e0
3 changed files with 17 additions and 13 deletions
+9 -5
View File
@@ -1,7 +1,10 @@
import asyncio
from fastapi import APIRouter
from lnbits.db import Database
from lnbits.helpers import template_renderer
from lnbits.tasks import catch_everything_and_restart
db = Database("ext_lnticket")
@@ -21,9 +24,10 @@ def lnticket_renderer():
from .views_api import * # noqa
from .views import * # noqa
from .tasks import register_listeners
from .tasks import wait_for_paid_invoices
def lnticket_start():
loop = asyncio.get_event_loop()
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
@lnticket_ext.on_event("startup")
def _do_it():
# FIXME: isn't called yet
register_listeners()