From b8e14058f202cbd8844f64f78666f2ee47adff1d Mon Sep 17 00:00:00 2001 From: Lukas Kirner <25691909+lukaskirner@users.noreply.github.com> Date: Wed, 21 May 2025 11:15:05 +0200 Subject: [PATCH] Geplace GETDEL by pipelined GET and DEL commands. (#682) GETDEL was added in Redis 6.2, but is unfortunately not supported on all Azure Cache for Redis tiers. Fixes #680. --- chirpstack/src/storage/downlink_frame.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chirpstack/src/storage/downlink_frame.rs b/chirpstack/src/storage/downlink_frame.rs index 7f312281..6dc9a0ef 100644 --- a/chirpstack/src/storage/downlink_frame.rs +++ b/chirpstack/src/storage/downlink_frame.rs @@ -24,7 +24,10 @@ pub async fn save(df: &internal::DownlinkFrame) -> Result<()> { pub async fn get_and_del(id: u32) -> Result { let key = redis_key(format!("frame:{}", id)); - let v: Vec = redis::cmd("GETDEL") + let (v, _): (Vec, u8) = redis::pipe() + .cmd("GET") + .arg(key.clone()) + .cmd("DEL") .arg(key) .query_async(&mut get_async_redis_conn().await?) .await?;