From 5220bf03437ad76b59dfdbb69637a7763496e6a8 Mon Sep 17 00:00:00 2001 From: yangsx <380129340@qq.com> Date: Mon, 1 Jul 2024 12:45:24 +0800 Subject: [PATCH] add idle time filter --- src/types/redis_stream.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/types/redis_stream.cc b/src/types/redis_stream.cc index 7d35117f7c2..67162aef87f 100644 --- a/src/types/redis_stream.cc +++ b/src/types/redis_stream.cc @@ -1758,6 +1758,10 @@ rocksdb::Status Stream::GetPendingEntries(StreamPendingOptions &options, StreamG last_entry_id = entry_id; } StreamPelEntry pel_entry = decodeStreamPelEntryValue(iter->value().ToString()); + if (options.with_time && util::GetTimeStampMS() - pel_entry.last_delivery_time_ms < options.idle_time) { + continue; + } + const std::string &consumer_name = pel_entry.consumer_name; if (options.with_consumer && options.consumer != consumer_name) {