Skip to content

Commit d991b5d

Browse files
TimelordUKclaude
andcommitted
fix: Cache purge pattern - use sql-cli: instead of sql_cli:
The cache keys are stored with hyphen (sql-cli:web:...) but purge was searching for underscore pattern (sql_cli:*), causing 0 entries to be found. Fixed pattern to match actual key format: sql-cli:* 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 398442d commit d991b5d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/redis_cache_module/redis_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl RedisCache {
268268
}
269269

270270
/// Check cache statistics
271-
/// Purge all cache entries (delete all keys matching sql_cli:* pattern)
271+
/// Purge all cache entries (delete all keys matching sql-cli:* pattern)
272272
pub fn purge_all(&mut self) -> Result<usize, String> {
273273
if !self.enabled {
274274
return Err("Cache not enabled".to_string());
@@ -277,7 +277,7 @@ impl RedisCache {
277277
let conn = self.connection.as_mut().ok_or("No connection")?;
278278

279279
// Scan for all keys matching our prefix
280-
let pattern = "sql_cli:*";
280+
let pattern = "sql-cli:*";
281281
let keys: Vec<String> = redis::cmd("KEYS")
282282
.arg(pattern)
283283
.query(conn)

0 commit comments

Comments
 (0)