fix unnecessary serialization of sender query keys

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-25 06:47:20 +00:00
parent 6ccfc9ed98
commit 6c66391988

View file

@ -103,8 +103,9 @@ impl Data {
pub fn active_requests_for(&self, destination: &Destination) -> impl Stream<Item = SendingItem> + Send + '_ {
let prefix = destination.get_prefix();
self.servercurrentevent_data
.stream_prefix_raw(&prefix)
.raw_stream_from(&prefix)
.ignore_err()
.ready_take_while(move |(key, _)| key.starts_with(&prefix))
.map(|(key, val)| {
let (_, event) = parse_servercurrentevent(key, val).expect("invalid servercurrentevent");
@ -152,8 +153,9 @@ impl Data {
pub fn queued_requests(&self, destination: &Destination) -> impl Stream<Item = QueueItem> + Send + '_ {
let prefix = destination.get_prefix();
self.servernameevent_data
.stream_prefix_raw(&prefix)
.raw_stream_from(&prefix)
.ignore_err()
.ready_take_while(move |(key, _)| key.starts_with(&prefix))
.map(|(key, val)| {
let (_, event) = parse_servercurrentevent(key, val).expect("invalid servercurrentevent");