fix: delete relay

This commit is contained in:
Vlad Stan 2023-02-08 12:58:19 +02:00
parent 24f803921e
commit 4b96f65c85
2 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,8 @@ class NostrClientManager:
async def disable_relay(self, relay_id: str):
await self._stop_clients_for_relay(relay_id)
del self._active_relays[relay_id]
if relay_id in self._active_relays:
del self._active_relays[relay_id]
def get_relay_config(self, relay_id: str) -> RelayConfig:
return self._active_relays[relay_id]
@ -93,7 +94,6 @@ class NostrClientConnection:
await self.websocket.accept()
while True:
json_data = await self.websocket.receive_text()
print("### received: ", json_data)
try:
data = json.loads(json_data)

View file

@ -15,7 +15,7 @@ from lnbits.decorators import (
)
from lnbits.helpers import urlsafe_short_hash
from . import client_manager, nostrrelay_ext
from . import nostrrelay_ext
from .client_manager import NostrClientConnection, NostrClientManager
from .crud import (
create_relay,