mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 16:40:35 +00:00
Add a new class derived from Seastar's `default_retry_strategy`. Relocate the `should_retry` implementation from Scylla's `default_retry_strategy` into the new class to centralize and standardize retry behavior.
27 lines
551 B
C++
27 lines
551 B
C++
/*
|
|
* Copyright (C) 2024-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
#include <seastar/http/retry_strategy.hh>
|
|
|
|
namespace aws {
|
|
|
|
class aws_error;
|
|
|
|
class default_aws_retry_strategy : public seastar::http::experimental::retry_strategy {
|
|
protected:
|
|
unsigned _max_retries;
|
|
|
|
public:
|
|
explicit default_aws_retry_strategy(unsigned max_retries = 10);
|
|
|
|
seastar::future<bool> should_retry(std::exception_ptr error, unsigned attempted_retries) const override;
|
|
};
|
|
|
|
} // namespace aws
|