We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bed471f commit 0882ef3Copy full SHA for 0882ef3
examples/redis/main.go
@@ -52,6 +52,12 @@ func main() {
52
// Close connections after remaining idle for given duration.
53
IdleTimeout: 5 * time.Minute,
54
}
55
+ defer func() {
56
+ if err := pool.Close(); err != nil {
57
+ level.Error(logger).Log("msg", "failed to close Redis connection pool", "err", err)
58
+ }
59
+ }()
60
+
61
c := pool.Get()
62
if _, err := c.Do("PING"); err != nil {
63
level.Error(logger).Log("msg", "Redis connection failed", "err", err)
0 commit comments