commitlog: cleanup segment sync()

Call cycle() only once.
Message-Id: <20200102155049.21291-4-gleb@scylladb.com>
This commit is contained in:
Gleb Natapov
2020-01-02 17:50:44 +02:00
committed by Avi Kivity
parent 3d3d2c572e
commit 1e15e1ef44

View File

@@ -597,7 +597,8 @@ public:
// Note: this is not a marker for when sync was finished.
// It is when it was initiated
reset_sync_time();
return _closed ? cycle(true).then([](sseg_ptr s) { return s->flush(); }) : cycle(true);
auto f = cycle(true);
return _closed ? f.then([](sseg_ptr s) { return s->flush(); }) : std::move(f);
}
// See class comment for info
future<sseg_ptr> flush(uint64_t pos = 0) {