From f73b3c07b3dc0727002bc8377443950fe291b559 Mon Sep 17 00:00:00 2001 From: DogsTaiFarmer Date: Thu, 25 Apr 2024 12:58:38 +0300 Subject: [PATCH] 2.1.11.post1 --- CHANGELOG.md | 4 ++++ exchanges_wrapper/__init__.py | 2 +- exchanges_wrapper/exch_srv.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cd975..fba887b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.11.post1 2024-04-xx +### Update +* `send_request`: controlling rate_limit by changing exception handling + ## 2.1.11 2024-04-19 ### Update * Some minor improvements diff --git a/exchanges_wrapper/__init__.py b/exchanges_wrapper/__init__.py index cf0b701..44d5f18 100755 --- a/exchanges_wrapper/__init__.py +++ b/exchanges_wrapper/__init__.py @@ -12,7 +12,7 @@ __contact__ = "https://github.com/DogsTailFarmer" __email__ = "jerry.fedorenko@yahoo.com" __credits__ = ["https://github.com/DanyaSWorlD"] -__version__ = "2.1.11" +__version__ = "2.1.11.post1" from pathlib import Path import shutil diff --git a/exchanges_wrapper/exch_srv.py b/exchanges_wrapper/exch_srv.py index 3747b19..f45f32a 100755 --- a/exchanges_wrapper/exch_srv.py +++ b/exchanges_wrapper/exch_srv.py @@ -240,7 +240,7 @@ async def send_request(self, client_method_name, request, rate_limit=False, **kw except asyncio.exceptions.TimeoutError: msg = f"{msg_header} timeout error" logger.warning(msg) - raise GRPCError(status=Status.OUT_OF_RANGE, message=msg) + raise GRPCError(status=Status.RESOURCE_EXHAUSTED, message=msg) except (errors.RateLimitReached, errors.QueryCanceled) as ex: Martin.rate_limit_reached_time = time.time() msg = f"{msg_header} RateLimitReached: {ex}"