Skip to content

Commit

Permalink
Merge branch 'main' of github.com:soxft/busuanzi
Browse files Browse the repository at this point in the history
  • Loading branch information
soxft committed Jul 31, 2024
2 parents 46cff97 + c03c806 commit 522d281
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions process/redisutil/redisutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package redisutil

import (
"context"
"crypto/tls"
"github.com/redis/go-redis/v9"
"github.com/soxft/busuanzi/config"

Expand All @@ -16,10 +17,19 @@ func Init() {

r := config.Redis

var tlsConfig *tls.Config

if r.TLS {
tlsConfig = &tls.Config{
MinVersion: tls.VersionTLS12,
}
}

rdb := redis.NewClient(&redis.Options{
Addr: r.Address,
Password: r.Password,
DB: r.Database,
TLSConfig: tlsConfig,
MinIdleConns: r.MinIdle,
MaxIdleConns: r.MaxIdle,
MaxRetries: r.MaxRetries,
Expand Down

0 comments on commit 522d281

Please sign in to comment.