V1 (#106)
This commit is contained in:
parent
83c94e94db
commit
0fc26d096f
52 changed files with 6684 additions and 3120 deletions
19
__init__.py
19
__init__.py
|
|
@ -1,11 +1,10 @@
|
|||
import asyncio
|
||||
|
||||
from fastapi import APIRouter
|
||||
from loguru import logger
|
||||
|
||||
from lnbits.db import Database
|
||||
from lnbits.helpers import template_renderer
|
||||
from lnbits.tasks import create_permanent_unique_task
|
||||
from loguru import logger
|
||||
|
||||
from .nostr.nostr_client import NostrClient
|
||||
|
||||
|
|
@ -24,14 +23,14 @@ nostrmarket_static_files = [
|
|||
def nostrmarket_renderer():
|
||||
return template_renderer(["nostrmarket/templates"])
|
||||
|
||||
|
||||
nostr_client: NostrClient = NostrClient()
|
||||
|
||||
|
||||
from .tasks import wait_for_nostr_events, wait_for_paid_invoices
|
||||
from .tasks import wait_for_nostr_events, wait_for_paid_invoices # noqa
|
||||
from .views import * # noqa
|
||||
from .views_api import * # noqa
|
||||
|
||||
|
||||
scheduled_tasks: list[asyncio.Task] = []
|
||||
|
||||
|
||||
|
|
@ -57,7 +56,13 @@ def nostrmarket_start():
|
|||
await asyncio.sleep(15)
|
||||
await wait_for_nostr_events(nostr_client)
|
||||
|
||||
task1 = create_permanent_unique_task("ext_nostrmarket_paid_invoices", wait_for_paid_invoices)
|
||||
task2 = create_permanent_unique_task("ext_nostrmarket_subscribe_to_nostr_client", _subscribe_to_nostr_client)
|
||||
task3 = create_permanent_unique_task("ext_nostrmarket_wait_for_events", _wait_for_nostr_events)
|
||||
task1 = create_permanent_unique_task(
|
||||
"ext_nostrmarket_paid_invoices", wait_for_paid_invoices
|
||||
)
|
||||
task2 = create_permanent_unique_task(
|
||||
"ext_nostrmarket_subscribe_to_nostr_client", _subscribe_to_nostr_client
|
||||
)
|
||||
task3 = create_permanent_unique_task(
|
||||
"ext_nostrmarket_wait_for_events", _wait_for_nostr_events
|
||||
)
|
||||
scheduled_tasks.extend([task1, task2, task3])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue