fix: fix batching during dispatch mode changes (#1713)

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
Vladislav 2023-08-18 15:39:34 +03:00 committed by GitHub
parent c65b9cf63d
commit 003d2031b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -798,8 +798,10 @@ void Connection::DispatchFiber(util::FiberSocketBase* peer) {
dispatch_q_.pop_front();
}
if (dispatch_q_.empty())
if (dispatch_q_.empty()) {
builder->FlushBatch();
builder->SetBatchMode(false); // in case the next dispatch is sync
}
} else {
MessageHandle msg = move(dispatch_q_.front());
dispatch_q_.pop_front();