return 0;
}
-static const std::chrono::seconds default_reshard_sleep_duration(5);
-
int RGWReshardWait::wait(optional_yield y)
{
std::unique_lock lock(mutex);
waiters.push_back(waiter);
lock.unlock();
- waiter.timer.expires_after(default_reshard_sleep_duration);
+ waiter.timer.expires_after(duration);
boost::system::error_code ec;
waiter.timer.async_wait(yield[ec]);
}
#endif
- cond.wait_for(lock, default_reshard_sleep_duration);
+ cond.wait_for(lock, duration);
if (going_down) {
return -ECANCELED;
};
class RGWReshardWait {
+ const ceph::timespan duration;
ceph::mutex mutex = ceph::make_mutex("RGWReshardWait::lock");
ceph::condition_variable cond;
bool going_down{false};
public:
- RGWReshardWait() = default;
+ RGWReshardWait(ceph::timespan duration = std::chrono::seconds(5))
+ : duration(duration) {}
~RGWReshardWait() {
ceph_assert(going_down);
}