Skip to content

Commit

Permalink
Fix loop when fetching pending messages
Browse files Browse the repository at this point in the history
Exclude lower band from redis range
  • Loading branch information
p1gp1g committed Dec 22, 2024
1 parent 30e497a commit 837ee58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autopush-common/src/db/redis/redis_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, Vec<u64>) = 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,
Expand Down

0 comments on commit 837ee58

Please sign in to comment.