Removed obsolete func
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "SendQueue.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <latch>
|
||||
|
||||
#include <boost/asio/bind_executor.hpp>
|
||||
@@ -308,7 +309,7 @@ namespace lms::core::http
|
||||
|
||||
void SendQueue::throttle(std::chrono::seconds requestedDuration)
|
||||
{
|
||||
const std::chrono::seconds duration{ clamp(requestedDuration, _minRetryWaitDuration, _maxRetryWaitDuration) };
|
||||
const std::chrono::seconds duration{ std::clamp(requestedDuration, _minRetryWaitDuration, _maxRetryWaitDuration) };
|
||||
LOG(DEBUG, "Throttling for " << duration.count() << " seconds");
|
||||
|
||||
_throttleTimer.expires_after(duration);
|
||||
|
||||
@@ -24,19 +24,16 @@
|
||||
|
||||
namespace lms::core::utils
|
||||
{
|
||||
template<class T, class Compare = std::less<>>
|
||||
constexpr T clamp(T v, T lo, T hi, Compare comp = {})
|
||||
{
|
||||
assert(!comp(hi, lo));
|
||||
return comp(v, lo) ? lo : comp(hi, v) ? hi :
|
||||
v;
|
||||
}
|
||||
|
||||
template<typename Container, typename T>
|
||||
void
|
||||
push_back_if_not_present(Container& container, const T& val)
|
||||
void push_back_if_not_present(Container& container, const T& val)
|
||||
{
|
||||
if (std::find(std::cbegin(container), std::cend(container), val) == std::cend(container))
|
||||
container.push_back(val);
|
||||
}
|
||||
|
||||
template<class... Ts>
|
||||
struct overloads : Ts...
|
||||
{
|
||||
using Ts::operator()...;
|
||||
};
|
||||
} // namespace lms::core::utils
|
||||
Reference in New Issue
Block a user