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.
2 parents 46cff97 + c03c806 commit 522d281Copy full SHA for 522d281
process/redisutil/redisutil.go
@@ -2,6 +2,7 @@ package redisutil
2
3
import (
4
"context"
5
+ "crypto/tls"
6
"github.com/redis/go-redis/v9"
7
"github.com/soxft/busuanzi/config"
8
@@ -16,10 +17,19 @@ func Init() {
16
17
18
r := config.Redis
19
20
+ var tlsConfig *tls.Config
21
+
22
+ if r.TLS {
23
+ tlsConfig = &tls.Config{
24
+ MinVersion: tls.VersionTLS12,
25
+ }
26
27
28
rdb := redis.NewClient(&redis.Options{
29
Addr: r.Address,
30
Password: r.Password,
31
DB: r.Database,
32
+ TLSConfig: tlsConfig,
33
MinIdleConns: r.MinIdle,
34
MaxIdleConns: r.MaxIdle,
35
MaxRetries: r.MaxRetries,
0 commit comments