* no need to capture this, it is already enclosed by `ref`
* use finally for capturing `ref`, and for printing out the "complete"
logging message. we could use a different branch for printing out
the failure message if any.
Signed-off-by: Kefu Chai <kchai@redhat.com>
}
}).then([this] {
return shard_services.send_pg_temp();
- }).then([this, ref=std::move(ref)] {
- logger().debug("{}: complete", *this);
+ }).finally([ref=std::move(ref)] {
+ logger().debug("{}: complete", *ref);
});
}