2022-01-28 16:22:54 +00:00
|
|
|
import asyncio
|
|
|
|
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from fastapi.staticfiles import StaticFiles
|
|
|
|
|
2022-01-27 12:24:38 +00:00
|
|
|
from lnbits.db import Database
|
2022-01-28 16:22:54 +00:00
|
|
|
from lnbits.helpers import template_renderer
|
|
|
|
from lnbits.tasks import catch_everything_and_restart
|
2022-01-27 12:24:38 +00:00
|
|
|
|
|
|
|
db = Database("ext_diagonalley")
|
|
|
|
|
2022-01-28 16:22:54 +00:00
|
|
|
|
|
|
|
diagonalley_ext: APIRouter = APIRouter(
|
|
|
|
prefix="/diagonalley", tags=["diagonalley"]
|
2022-01-27 12:24:38 +00:00
|
|
|
)
|
|
|
|
|
2022-01-28 16:22:54 +00:00
|
|
|
def diagonalley_renderer():
|
|
|
|
return template_renderer(["lnbits/extensions/diagonalley/templates"])
|
|
|
|
|
|
|
|
|
|
|
|
from .tasks import wait_for_paid_invoices
|
2022-01-27 12:24:38 +00:00
|
|
|
from .views import * # noqa
|
2022-01-28 16:22:54 +00:00
|
|
|
from .views_api import * # noqa
|
|
|
|
|
2022-01-27 12:24:38 +00:00
|
|
|
|
2022-01-28 16:22:54 +00:00
|
|
|
def diagonalley_start():
|
|
|
|
loop = asyncio.get_event_loop()
|
2022-02-04 13:05:48 +00:00
|
|
|
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
|