mirror of
https://github.com/aljazceru/python-nostr.git
synced 2025-12-19 23:34:19 +01:00
expose timeout parameter for ws open
This commit is contained in:
@@ -30,8 +30,11 @@ class Relay:
|
|||||||
self.ws = ws
|
self.ws = ws
|
||||||
self.subscriptions = subscriptions
|
self.subscriptions = subscriptions
|
||||||
|
|
||||||
def open_websocket_connection(self) -> None:
|
def open_websocket_connection(self, timeout=None) -> None:
|
||||||
self.ws.connect(self.url, timeout=1)
|
if timeout != None:
|
||||||
|
self.ws.connect(self.url, timeout)
|
||||||
|
else:
|
||||||
|
self.ws.connect(self.url)
|
||||||
|
|
||||||
def close_websocket_connection(self) -> None:
|
def close_websocket_connection(self) -> None:
|
||||||
self.ws.close()
|
self.ws.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user