Fix binlog closing.

GitOrigin-RevId: 3dc04b07a2d7c72e8f99f360c6b8f02cb74ce931
This commit is contained in:
levlam 2020-08-16 16:48:20 +03:00
parent 3282a873cb
commit f0d1afcb7a

View File

@ -20,15 +20,17 @@ class BinlogActor : public Actor {
} }
void close(Promise<> promise) { void close(Promise<> promise) {
binlog_->close().ensure(); binlog_->close().ensure();
promise.set_value(Unit());
LOG(INFO) << "Finished to close binlog"; LOG(INFO) << "Finished to close binlog";
stop(); stop();
promise.set_value(Unit()); // setting promise can complete closing and destroy the current actor context
} }
void close_and_destroy(Promise<> promise) { void close_and_destroy(Promise<> promise) {
binlog_->close_and_destroy().ensure(); binlog_->close_and_destroy().ensure();
promise.set_value(Unit());
LOG(INFO) << "Finished to destroy binlog"; LOG(INFO) << "Finished to destroy binlog";
stop(); stop();
promise.set_value(Unit()); // setting promise can complete closing and destroy the current actor context
} }
struct Event { struct Event {