crimson/osd: reduce the indent

instead of using a lambda, use a future variable for reducing the indent
level.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-02-28 13:19:56 +08:00
parent 5e197a21e6
commit c1a8ad1213

View File

@ -53,14 +53,12 @@ seastar::future<> PeeringEvent::start()
logger().debug("{}: start", *this);
IRef ref = this;
return [this] {
if (delay) {
return seastar::sleep(std::chrono::milliseconds(
std::lround(delay*1000)));
} else {
return seastar::now();
}
}().then([this] {
auto maybe_delay = seastar::now();
if (delay) {
maybe_delay = seastar::sleep(
std::chrono::milliseconds(std::lround(delay * 1000)));
}
return maybe_delay.then([this] {
return get_pg();
}).then([this](Ref<PG> pg) {
if (!pg) {