From 66e148414918076209fc7b41a29448e7dd19f337 Mon Sep 17 00:00:00 2001 From: "Tucker J. Pelletier" Date: Fri, 9 Dec 2022 13:25:03 -0500 Subject: [PATCH] Adding a delete key method. --- .../groovy/grails/plugins/redis/RedisService.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/groovy/grails/plugins/redis/RedisService.groovy b/src/main/groovy/grails/plugins/redis/RedisService.groovy index 4cb691d..b8a7580 100644 --- a/src/main/groovy/grails/plugins/redis/RedisService.groovy +++ b/src/main/groovy/grails/plugins/redis/RedisService.groovy @@ -363,6 +363,17 @@ class RedisService { } } + /** + * Deletes key from redis. + * + * @param key The key to delete. + */ + void deleteKey(String key){ + withRedis { Jedis redis -> + redis.del(key) + } + } + def memoizeList(String key, Integer expire, Closure closure) { memoizeList(key, [expire: expire], closure) }