mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
crimson/common/errorator: fix finally
We need to specify the return type here to ensure we don't lose the errorator properties. Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
ba055a743c
commit
c820d40aca
@ -596,14 +596,14 @@ private:
|
||||
}
|
||||
|
||||
template <class FuncT>
|
||||
auto finally(FuncT &&func) {
|
||||
_future finally(FuncT &&func) {
|
||||
return this->then_wrapped(
|
||||
[func = std::forward<FuncT>(func)](auto &&result) mutable noexcept {
|
||||
if constexpr (seastar::is_future<std::invoke_result_t<FuncT>>::value) {
|
||||
return ::seastar::futurize_invoke(std::forward<FuncT>(func)).then_wrapped(
|
||||
[result = std::move(result)](auto&& f_res) mutable {
|
||||
// TODO: f_res.failed()
|
||||
f_res.discard_result();
|
||||
(void)f_res.discard_result();
|
||||
return std::move(result);
|
||||
});
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user