summaryrefslogtreecommitdiffstats
path: root/modules/cache/cache_redis.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-05-15 20:43:27 +0200
committerGitHub <noreply@github.com>2022-05-15 20:43:27 +0200
commit00a981d341dfa62d2a9667b01500820ec7ddf19a (patch)
treefc95b030791d6629d277cfe48a3380f296cf5adb /modules/cache/cache_redis.go
parent3a245230f494b9d6a7e5c688cbb3c7f7c3a33cbd (diff)
downloadgitea-00a981d341dfa62d2a9667b01500820ec7ddf19a.tar.gz
gitea-00a981d341dfa62d2a9667b01500820ec7ddf19a.zip
Update go-chi/cache to utilize Ping() (#19719)
* update gitea.com/go-chi/cache -> v0.2.0 * ajust to new interface * refactor
Diffstat (limited to 'modules/cache/cache_redis.go')
-rw-r--r--modules/cache/cache_redis.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/cache/cache_redis.go b/modules/cache/cache_redis.go
index ff6c8d424c..7bb71f08ce 100644
--- a/modules/cache/cache_redis.go
+++ b/modules/cache/cache_redis.go
@@ -153,6 +153,11 @@ func (c *RedisCacher) StartAndGC(opts cache.Options) error {
return c.c.Ping(graceful.GetManager().HammerContext()).Err()
}
+// Ping tests if the cache is alive.
+func (c *RedisCacher) Ping() error {
+ return c.c.Ping(graceful.GetManager().HammerContext()).Err()
+}
+
func init() {
cache.Register("redis", &RedisCacher{})
}