2022-07-02 21:16:27 -06:00
|
|
|
import asyncio
|
|
|
|
|
2021-10-06 19:43:57 +01:00
|
|
|
from fastapi import APIRouter
|
|
|
|
|
2021-10-06 14:49:00 +01:00
|
|
|
from lnbits.db import Database
|
2021-10-06 19:43:57 +01:00
|
|
|
from lnbits.helpers import template_renderer
|
2022-07-02 21:16:27 -06:00
|
|
|
from lnbits.tasks import catch_everything_and_restart
|
2021-10-06 14:49:00 +01:00
|
|
|
|
|
|
|
db = Database("ext_tpos")
|
|
|
|
|
2021-11-12 04:14:55 +00:00
|
|
|
tpos_ext: APIRouter = APIRouter(prefix="/tpos", tags=["TPoS"])
|
2021-10-06 14:49:00 +01:00
|
|
|
|
2021-10-17 18:33:29 +01:00
|
|
|
|
2021-10-06 19:43:57 +01:00
|
|
|
def tpos_renderer():
|
2021-10-17 18:33:29 +01:00
|
|
|
return template_renderer(["lnbits/extensions/tpos/templates"])
|
2021-10-06 19:43:57 +01:00
|
|
|
|
2022-07-05 17:18:22 +02:00
|
|
|
|
2022-07-02 21:16:27 -06:00
|
|
|
from .tasks import wait_for_paid_invoices
|
2021-10-06 14:49:00 +01:00
|
|
|
from .views import * # noqa
|
2022-07-16 14:23:03 +02:00
|
|
|
from .views_api import * # noqa
|
2022-07-02 21:16:27 -06:00
|
|
|
|
2022-07-05 17:18:22 +02:00
|
|
|
|
2022-07-02 21:16:27 -06:00
|
|
|
def tpos_start():
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
|