summaryrefslogtreecommitdiff
path: root/include/tgbot/net
diff options
context:
space:
mode:
authorDmitry Mikushin <dmitry@kernelgen.org>2023-02-12 22:38:29 +0100
committerDmitry Mikushin <dmitry@kernelgen.org>2023-02-12 22:38:29 +0100
commit97b0eb447e36308cd6783add28de88e429627bfe (patch)
treedc2bc2f55b504dd9970091ca6c96441936127cfd /include/tgbot/net
parent0519ebae651d8d7466d4392a2ddb718c19c5c650 (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.h12
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;
};
}