diff options
author | Dmitry Mikushin <dmitry@kernelgen.org> | 2023-02-12 22:38:29 +0100 |
---|---|---|
committer | Dmitry Mikushin <dmitry@kernelgen.org> | 2023-02-12 22:38:29 +0100 |
commit | 97b0eb447e36308cd6783add28de88e429627bfe (patch) | |
tree | dc2bc2f55b504dd9970091ca6c96441936127cfd /include/tgbot/net | |
parent | 0519ebae651d8d7466d4392a2ddb718c19c5c650 (diff) |
Parameterizing the number of retries and backoff duration for HttpClient.makeRequest
Diffstat (limited to 'include/tgbot/net')
-rw-r--r-- | include/tgbot/net/HttpClient.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/tgbot/net/HttpClient.h b/include/tgbot/net/HttpClient.h index 024c8ad..90b93dd 100644 --- a/include/tgbot/net/HttpClient.h +++ b/include/tgbot/net/HttpClient.h @@ -28,6 +28,18 @@ public: virtual std::string makeRequest(const Url& url, const std::vector<HttpReqArg>& args) const = 0; std::int32_t _timeout = 25; + + virtual int getRequestMaxRetries() const { + return requestMaxRetries; + } + + virtual int getRequestBackoff() const { + return requestBackoff; + } + +private: + int requestMaxRetries = 3; + int requestBackoff = 1; }; } |