From 97b0eb447e36308cd6783add28de88e429627bfe Mon Sep 17 00:00:00 2001 From: Dmitry Mikushin Date: Sun, 12 Feb 2023 22:38:29 +0100 Subject: Parameterizing the number of retries and backoff duration for HttpClient.makeRequest --- include/tgbot/net/HttpClient.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') 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& 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; }; } -- cgit v1.2.3