Skip to content

Commit f2f6d03

Browse files
committed
Fix loop when fetching pending messages
Exclude lower band from redis range
1 parent 4dfd29d commit f2f6d03

File tree

1 file changed

+3
-2
lines changed
  • autopush-common/src/db/redis/redis_client

1 file changed

+3
-2
lines changed

autopush-common/src/db/redis/redis_client/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,11 @@ impl DbClient for RedisClientImpl {
459459
trace!("🐰 Fecthing {} messages since {:?}", limit, timestamp);
460460
let mut con = self.connection().await?;
461461
let msg_list_key = self.message_list_key(&uaid);
462+
// ZRANGE Key (x +inf LIMIT 0 limit
462463
let (messages_id, mut scores): (Vec<String>, Vec<u64>) = con
463-
.zrangebyscore_limit_withscores::<&str, u64, &str, Vec<(String, u64)>>(
464+
.zrangebyscore_limit_withscores::<&str, &str, &str, Vec<(String, u64)>>(
464465
&msg_list_key,
465-
timestamp.unwrap_or(0),
466+
&format!("({}", timestamp.unwrap_or(0)),
466467
"+inf",
467468
0,
468469
limit as isize,

0 commit comments

Comments
 (0)