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.
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/CHANGELOG.md +4 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/PKG-INFO +1 -1
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/crypto_ws_api/__init__.py +2 -2
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/crypto_ws_api/ws_session.py +3 -2
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/.deepsource.toml +0 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/LICENSE.md +0 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/README.md +0 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/crypto_ws_api/demo.py +0 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/crypto_ws_api/ws_api.toml.template +0 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/pyproject.toml +0 -0
- {crypto-ws-api-2.0.7 → crypto-ws-api-2.0.8}/requirements.txt +0 -0
|
@@ -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.
|
|
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
|
|
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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|