From 1e83f81d3a6930cd3c2e2a91223d02170c0f3b09 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 8 Oct 2024 14:02:08 -0400 Subject: [PATCH] Fix deleting secondary index from redis on limit deletion Signed-off-by: Alex Snaps --- limitador/src/storage/redis/redis_async.rs | 2 ++ limitador/src/storage/redis/redis_sync.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/limitador/src/storage/redis/redis_async.rs b/limitador/src/storage/redis/redis_async.rs index 31bf946e..85563792 100644 --- a/limitador/src/storage/redis/redis_async.rs +++ b/limitador/src/storage/redis/redis_async.rs @@ -229,6 +229,8 @@ impl AsyncRedisStorage { .await?; } + con.del::<_, ()>(key_for_counters_of_limit(limit)).await?; + Ok(()) } } diff --git a/limitador/src/storage/redis/redis_sync.rs b/limitador/src/storage/redis/redis_sync.rs index 4c0619ee..08e5082b 100644 --- a/limitador/src/storage/redis/redis_sync.rs +++ b/limitador/src/storage/redis/redis_sync.rs @@ -156,6 +156,7 @@ impl CounterStorage for RedisStorage { for counter_key in counter_keys { con.del::<_, ()>(counter_key)?; } + con.del::<_, ()>(key_for_counters_of_limit(limit))?; } Ok(())