File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ class Binance(Feed, BinanceRestMixin):
45
45
ORDER_INFO : ORDER_INFO
46
46
}
47
47
request_limit = 20
48
+ per_connection_limit = 1024
48
49
49
50
@classmethod
50
51
def timestamp_normalize (cls , ts : float ) -> float :
@@ -135,14 +136,14 @@ def _address(self) -> Union[str, Dict]:
135
136
pair = pair .lower ()
136
137
subs .append (f"{ pair } @{ stream } " )
137
138
138
- if 0 < len (subs ) < 200 :
139
+ if 0 < len (subs ) < self . per_connection_limit :
139
140
return address + '/' .join (subs )
140
141
else :
141
142
def split_list (_list : list , n : int ):
142
143
for i in range (0 , len (_list ), n ):
143
144
yield _list [i :i + n ]
144
145
145
- return [address + '/' .join (chunk ) for chunk in split_list (subs , 200 )]
146
+ return [address + '/' .join (chunk ) for chunk in split_list (subs , self . per_connection_limit )]
146
147
147
148
def _reset (self ):
148
149
self ._l2_book = {}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def test_binance_address_generation():
22
22
sub = random .sample (symbols , length )
23
23
addr = Binance (symbols = sub , channels = channels )._address ()
24
24
25
- if length * len (channels ) < 200 :
25
+ if length * len (channels ) < 1024 :
26
26
assert isinstance (addr , str )
27
27
value = addr .split ("=" , 1 )[1 ]
28
28
value = value .split ("/" )
You can’t perform that action at this time.
0 commit comments