mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-02 07:50:44 +00:00
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.
This commit is contained in:
parent
10731c2be5
commit
b8e14058f2
@ -24,7 +24,10 @@ pub async fn save(df: &internal::DownlinkFrame) -> Result<()> {
|
||||
|
||||
pub async fn get_and_del(id: u32) -> Result<internal::DownlinkFrame, Error> {
|
||||
let key = redis_key(format!("frame:{}", id));
|
||||
let v: Vec<u8> = redis::cmd("GETDEL")
|
||||
let (v, _): (Vec<u8>, u8) = redis::pipe()
|
||||
.cmd("GET")
|
||||
.arg(key.clone())
|
||||
.cmd("DEL")
|
||||
.arg(key)
|
||||
.query_async(&mut get_async_redis_conn().await?)
|
||||
.await?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user