mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
fix: aggregate xread and xrange replys (#1383)
This commit is contained in:
parent
e837b3d229
commit
302623c645
1 changed files with 6 additions and 0 deletions
|
@ -1460,6 +1460,8 @@ void XReadBlock(ReadOpts opts, ConnectionContext* cntx) {
|
|||
cntx->transaction->Execute(std::move(range_cb), true);
|
||||
|
||||
if (result) {
|
||||
SinkReplyBuilder::ReplyAggregator agg(cntx->reply_builder());
|
||||
|
||||
(*cntx)->StartArray(1);
|
||||
|
||||
(*cntx)->StartArray(2);
|
||||
|
@ -1567,6 +1569,8 @@ void StreamFamily::XRead(CmdArgList args, ConnectionContext* cntx) {
|
|||
}
|
||||
}
|
||||
|
||||
SinkReplyBuilder::ReplyAggregator agg(cntx->reply_builder());
|
||||
|
||||
(*cntx)->StartArray(resolved_streams);
|
||||
for (size_t i = 0; i != res.size(); i++) {
|
||||
// Ignore empty streams.
|
||||
|
@ -1677,6 +1681,8 @@ void StreamFamily::XRangeGeneric(CmdArgList args, bool is_rev, ConnectionContext
|
|||
OpResult<RecordVec> result = cntx->transaction->ScheduleSingleHopT(std::move(cb));
|
||||
|
||||
if (result) {
|
||||
SinkReplyBuilder::ReplyAggregator agg(cntx->reply_builder());
|
||||
|
||||
(*cntx)->StartArray(result->size());
|
||||
for (const auto& item : *result) {
|
||||
(*cntx)->StartArray(2);
|
||||
|
|
Loading…
Reference in a new issue