From 837ee583ed275cf5f3ef203d5bfe06c439410879 Mon Sep 17 00:00:00 2001 From: sim Date: Sun, 22 Dec 2024 20:10:02 +0000 Subject: [PATCH] Fix loop when fetching pending messages Exclude lower band from redis range --- autopush-common/src/db/redis/redis_client/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autopush-common/src/db/redis/redis_client/mod.rs b/autopush-common/src/db/redis/redis_client/mod.rs index c3b6f2f0..6a57d6d9 100644 --- a/autopush-common/src/db/redis/redis_client/mod.rs +++ b/autopush-common/src/db/redis/redis_client/mod.rs @@ -459,10 +459,11 @@ impl DbClient for RedisClientImpl { trace!("🐰 Fecthing {} messages since {:?}", limit, timestamp); let mut con = self.connection().await?; let msg_list_key = self.message_list_key(&uaid); + // ZRANGE Key (x +inf LIMIT 0 limit let (messages_id, mut scores): (Vec, Vec) = con - .zrangebyscore_limit_withscores::<&str, u64, &str, Vec<(String, u64)>>( + .zrangebyscore_limit_withscores::<&str, &str, &str, Vec<(String, u64)>>( &msg_list_key, - timestamp.unwrap_or(0), + &format!("({}", timestamp.unwrap_or(0)), "+inf", 0, limit as isize,