register channel listeners instead of callbacks.

makes for a little less black magic and more reasonable use of nurseries
and less unnecessary pseudo-requests.
This commit is contained in:
fiatjaf
2020-10-06 01:50:56 -03:00
parent 95e8573ff8
commit c5352c0309
8 changed files with 65 additions and 30 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ lnurlp_ext: Blueprint = Blueprint("lnurlp", __name__, static_folder="static", te
from .views_api import * # noqa
from .views import * # noqa
from .lnurl import * # noqa
from .tasks import on_invoice_paid
from .tasks import register_listeners
from lnbits.tasks import register_invoice_listener
from lnbits.tasks import record_async
register_invoice_listener("lnurlp", on_invoice_paid)
lnurlp_ext.record(record_async(register_listeners))