diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2023-07-02 11:23:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-02 11:23:24 +0300 |
commit | 782596206764e663b9b45401b447871f21ce62b2 (patch) | |
tree | 437653b6401fa8ee26d8028216fa4b96b521dfec /include | |
parent | 36a7f0798728482ddaaaecd5e86b64039d6d1175 (diff) | |
parent | 019c557ecef3433be80421c9583684ac7c04666d (diff) |
Merge pull request #282 from reo7sp/revert-280-revert-262-repeat-http-request-on-fail
Revert "Revert "Repeat the http request on fail""
Diffstat (limited to 'include')
-rw-r--r-- | include/tgbot/net/HttpClient.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/tgbot/net/HttpClient.h b/include/tgbot/net/HttpClient.h index aa82c0d..1f1b2a2 100644 --- a/include/tgbot/net/HttpClient.h +++ b/include/tgbot/net/HttpClient.h @@ -29,6 +29,24 @@ public: virtual std::string makeRequest(const Url& url, const std::vector<HttpReqArg>& args) const = 0; std::int32_t _timeout = 25; + + /** + * @brief Get the maximum number of makeRequest() retries before giving up and throwing an exception. + */ + virtual int getRequestMaxRetries() const { + return requestMaxRetries; + } + + /** + * @brief Get the makeRequest() backoff duration between retries, in seconds. + */ + virtual int getRequestBackoff() const { + return requestBackoff; + } + +private: + int requestMaxRetries = 3; + int requestBackoff = 1; }; } |