From 29a7ed813289828cfa78afab7dc2f08af25be4ac Mon Sep 17 00:00:00 2001 From: jeffthibault Date: Wed, 27 Jul 2022 12:30:53 -0400 Subject: [PATCH] expose timeout parameter for ws open --- nostr/relay.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nostr/relay.py b/nostr/relay.py index bc75e25..01ac875 100644 --- a/nostr/relay.py +++ b/nostr/relay.py @@ -30,8 +30,11 @@ class Relay: self.ws = ws self.subscriptions = subscriptions - def open_websocket_connection(self) -> None: - self.ws.connect(self.url, timeout=1) + def open_websocket_connection(self, timeout=None) -> None: + if timeout != None: + self.ws.connect(self.url, timeout) + else: + self.ws.connect(self.url) def close_websocket_connection(self) -> None: self.ws.close()