crypto-ws-api 2.0.7__tar.gz → 2.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ ## 2.0.8 - 2024-03-31
2
+ ### Fix
3
+ * tons log records: `websockets socket.send() raised exception.`
4
+
1
5
  ## 2.0.7 - 2024-03-25
2
6
  ### Update
3
7
  * Refactoring and some minor fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crypto-ws-api
3
- Version: 2.0.7
3
+ Version: 2.0.8
4
4
  Summary: Crypto WS API connector for ASYNC requests
5
5
  Author-email: Jerry Fedorenko <jerry.fedorenko@yahoo.com>
6
6
  Requires-Python: >=3.8
@@ -13,7 +13,7 @@ __maintainer__ = "Jerry Fedorenko"
13
13
  __contact__ = "https://github.com/DogsTailFarmer"
14
14
  __email__ = "jerry.fedorenko@yahoo.com"
15
15
  __credits__ = ["https://github.com/DanyaSWorlD"]
16
- __version__ = "2.0.7"
16
+ __version__ = "2.0.8"
17
17
 
18
18
  from pathlib import Path
19
19
  import shutil
@@ -21,7 +21,7 @@ from platformdirs import user_config_path
21
21
 
22
22
 
23
23
  TIMEOUT = 5 # sec timeout for WSS initialization and get response
24
- DELAY = 0.1 # sec delay in while loop
24
+ DELAY = 0.1 # sec delay in keepalive loop
25
25
  # Maximum str size for unique query ID
26
26
  ID_LEN_LIMIT = {
27
27
  "binance": 36,
@@ -104,7 +104,7 @@ class UserWSS:
104
104
  elif self.exchange in ['okx', 'bitfinex']:
105
105
  self._response_pool[res.get('id') or self.ws_id] = res.get('data') or res
106
106
  self.in_event.set()
107
- await asyncio.sleep(0)
107
+ await asyncio.sleep(0)
108
108
  else:
109
109
  logger.warning(f"UserWSS: {self.ws_id}: {msg}")
110
110
  await self.stop()
@@ -171,9 +171,10 @@ class UserWSS:
171
171
  await self._ws.send(
172
172
  json.dumps(self.compose_request(_id, _api_key, method, params, _signed))
173
173
  )
174
+ await asyncio.sleep(0)
174
175
  try:
175
176
  res = await asyncio.wait_for(self._response_distributor(_id), timeout=TIMEOUT)
176
- except asyncio.TimeoutError:
177
+ except asyncio.exceptions.TimeoutError:
177
178
  logger.warning(f"UserWSS: get response timeout error: {self.ws_id}")
178
179
  await self.stop()
179
180
  except asyncio.CancelledError:
File without changes
File without changes