Skip to content

Commit 3ee20b5

Browse files
author
Sam McHardy
authored
Merge pull request sammchardy#302 from JSRossiter/user-socket-timeout
allow custom user_timeout
2 parents 3acf9a0 + 33aa58f commit 3ee20b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

binance/websockets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ class BinanceSocketManager(threading.Thread):
6666
WEBSOCKET_DEPTH_10 = '10'
6767
WEBSOCKET_DEPTH_20 = '20'
6868

69-
_user_timeout = 30 * 60 # 30 minutes
69+
DEFAULT_USER_TIMEOUT = 30 * 60 # 30 minutes
7070

71-
def __init__(self, client):
71+
def __init__(self, client, user_timeout=DEFAULT_USER_TIMEOUT):
7272
"""Initialise the BinanceSocketManager
7373
7474
:param client: Binance API client
@@ -81,6 +81,7 @@ def __init__(self, client):
8181
self._user_listen_key = None
8282
self._user_callback = None
8383
self._client = client
84+
self._user_timeout = user_timeout
8485

8586
def _start_socket(self, path, callback, prefix='ws/'):
8687
if path in self._conns:

0 commit comments

Comments
 (0)