refactor: extract client_manager

This commit is contained in:
Vlad Stan 2023-02-08 08:49:52 +02:00
parent 14df3a6ffb
commit b2b5058784
2 changed files with 5 additions and 3 deletions

View file

@ -22,10 +22,13 @@ def nostrrelay_renderer():
return template_renderer(["lnbits/extensions/nostrrelay/templates"])
from .client_manager import NostrClientManager
from .models import NostrRelay
from .views import * # noqa
from .views_api import * # noqa
client_manager = NostrClientManager()
settings.lnbits_relay_information = {
"name": "LNbits Nostr Relay",
"description": "Multiple relays are supported",

View file

@ -15,8 +15,8 @@ from lnbits.decorators import (
)
from lnbits.helpers import urlsafe_short_hash
from . import nostrrelay_ext
from .client_manager import NostrClientConnection, NostrClientManager
from . import client_manager, nostrrelay_ext
from .client_manager import NostrClientConnection
from .crud import (
create_relay,
delete_relay,
@ -27,7 +27,6 @@ from .crud import (
)
from .models import NostrRelay
client_manager = NostrClientManager()
@nostrrelay_ext.websocket("/{relay_id}")
async def websocket_endpoint(relay_id: str, websocket: WebSocket):