Skip to content

Commit c2e9f7c

Browse files
authored
Deprecates unused methods in network settings (#1397)
NetworkSettings::GetRetries() is not used in any of network implementations so it can be freely deprecated and removed. Related method NetworkSettings::WithRetries(...) can aslo be deprecated and removed. Relates-To: OLPSUP-23500 Signed-off-by: Yauheni Khnykin <yauheni.khnykin@here.com>
1 parent 693ca9c commit c2e9f7c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

olp-cpp-sdk-core/include/olp/core/http/NetworkSettings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class CORE_API NetworkSettings final {
4141
*
4242
* @return The maximum number of retries for the HTTP request.
4343
*/
44+
OLP_SDK_DEPRECATED("Will be removed by 04.2024")
4445
std::size_t GetRetries() const;
4546

4647
/**
@@ -50,6 +51,7 @@ class CORE_API NetworkSettings final {
5051
*
5152
* @return A reference to *this.
5253
*/
54+
OLP_SDK_DEPRECATED("Will be removed by 04.2024")
5355
NetworkSettings& WithRetries(std::size_t retries);
5456

5557
/**

olp-cpp-sdk-core/src/client/OlpClient.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,6 @@ CancellationToken OlpClient::OlpClientImpl::CallApi(
580580
http::NetworkSettings()
581581
.WithConnectionTimeout(std::chrono::seconds(retry_settings.timeout))
582582
.WithTransferTimeout(std::chrono::seconds(retry_settings.timeout))
583-
.WithRetries(retry_settings.max_attempts)
584583
.WithProxySettings(std::move(proxy)));
585584

586585
auto network = settings_.network_request_handler;

olp-cpp-sdk-core/tests/http/NetworkSettingsTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ TEST(NetworkSettingsTest, WithTransferTimeout) {
6161
EXPECT_EQ(settings.GetTransferTimeoutDuration(), std::chrono::seconds(15));
6262
}
6363

64+
TEST(NetworkSettingsTest, WithRetriesDeprecated) {
65+
const auto settings = olp::http::NetworkSettings().WithRetries(5);
66+
EXPECT_EQ(settings.GetRetries(), 5);
67+
}
68+
6469
} // namespace
6570

6671
PORTING_POP_WARNINGS()

0 commit comments

Comments
 (0)