[Add] only keep stream after connected
This commit is contained in:
parent
6b11836816
commit
af3e90c280
@ -107,8 +107,6 @@ class BinanceGateway(BaseGateway):
|
||||
self.market_ws_api = BinanceDataWebsocketApi(self)
|
||||
self.rest_api = BinanceRestApi(self)
|
||||
|
||||
self.event_engine.register(EVENT_TIMER, self.process_timer_event)
|
||||
|
||||
def connect(self, setting: dict):
|
||||
""""""
|
||||
key = setting["key"]
|
||||
@ -121,6 +119,8 @@ class BinanceGateway(BaseGateway):
|
||||
proxy_host, proxy_port)
|
||||
self.market_ws_api.connect(proxy_host, proxy_port)
|
||||
|
||||
self.event_engine.register(EVENT_TIMER, self.process_timer_event)
|
||||
|
||||
def subscribe(self, req: SubscribeRequest):
|
||||
""""""
|
||||
self.market_ws_api.subscribe(req)
|
||||
|
Loading…
Reference in New Issue
Block a user