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

View file

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