Skip to content

Commit

Permalink
Add an option to enable TLS connection to external redis server like …
Browse files Browse the repository at this point in the history
…upstash
  • Loading branch information
L1H0n9Jun committed Jan 4, 2024
1 parent 3e53ab5 commit 60fd57c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Redis:
Address: redis:6379 # redis地址
Password:
Database: 0
TLS: false # 是否使用TLS连接redis
Prefix: bsz # redis前缀
MaxIdle: 25 # 最大空闲连接数
MaxActive: 100 # 最大连接数
Expand Down
2 changes: 1 addition & 1 deletion process/redisutil/redisutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func init() {
c, err := redis.Dial("tcp", config.Redis.Address,
redis.DialPassword(config.Redis.Password),
redis.DialDatabase(config.Redis.Database),
redis.DialUseTLS(true),
redis.DialUseTLS(config.Redis.TLS),
)
if err != nil {
log.Fatalf("redis connect error: %s", err.Error())
Expand Down

0 comments on commit 60fd57c

Please sign in to comment.