splitpayments/__init__.py
Tiago Vasconcelos 4623b2e0a7
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
allow custom path (#9)
* allow custom path
* bump

---------

Co-authored-by: dni  <office@dnilabs.com>
2023-09-26 12:44:12 +01:00

37 lines
900 B
Python

import asyncio
from typing import List
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_splitpayments")
scheduled_tasks: List[asyncio.Task] = []
splitpayments_static_files = [
{
"path": "/splitpayments/static",
"name": "splitpayments_static",
}
]
splitpayments_ext: APIRouter = APIRouter(
prefix="/splitpayments", tags=["splitpayments"]
)
def splitpayments_renderer():
return template_renderer(["splitpayments/templates"])
from .tasks import wait_for_paid_invoices
from .views import * # noqa: F401,F403
from .views_api import * # noqa: F401,F403
def splitpayments_start():
loop = asyncio.get_event_loop()
task = loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
scheduled_tasks.append(task)