Fix small bug from merge conflicts resolving.

This commit is contained in:
Davide Casale
2022-11-22 18:58:36 +01:00
parent 256841099b
commit acbed0bc57

View File

@@ -8,7 +8,7 @@ from .handlers import Channels, PublicChannelsHandler, AuthenticatedChannelsHand
from .exceptions import ConnectionNotOpen, TooManySubscriptions, WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, OutdatedClientVersion from .exceptions import ConnectionNotOpen, TooManySubscriptions, WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, OutdatedClientVersion
from ..utils.logger import CustomLogger from ..utils.logger import Formatter, CustomLogger
HEARTBEAT = "hb" HEARTBEAT = "hb"
@@ -30,7 +30,7 @@ class BfxWebsocketClient(object):
*AuthenticatedChannelsHandler.EVENTS *AuthenticatedChannelsHandler.EVENTS
] ]
def __init__(self, host, buckets=5, API_KEY=None, API_SECRET=None): def __init__(self, host, buckets=5, log_level = "INFO", API_KEY=None, API_SECRET=None):
self.host, self.websocket, self.event_emitter = host, None, AsyncIOEventEmitter() self.host, self.websocket, self.event_emitter = host, None, AsyncIOEventEmitter()
self.API_KEY, self.API_SECRET, self.authentication = API_KEY, API_SECRET, False self.API_KEY, self.API_SECRET, self.authentication = API_KEY, API_SECRET, False
@@ -39,6 +39,8 @@ class BfxWebsocketClient(object):
self.buckets = [ _BfxWebsocketBucket(self.host, self.event_emitter, self.__bucket_open_signal) for _ in range(buckets) ] self.buckets = [ _BfxWebsocketBucket(self.host, self.event_emitter, self.__bucket_open_signal) for _ in range(buckets) ]
self.logger = CustomLogger("BfxWebsocketClient", logLevel=log_level)
async def start(self): async def start(self):
tasks = [ bucket._connect(index) for index, bucket in enumerate(self.buckets) ] tasks = [ bucket._connect(index) for index, bucket in enumerate(self.buckets) ]