Skip to content

Commit

Permalink
fix Client opt (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddo authored Aug 28, 2024
1 parent 1d99fa9 commit 9136dde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion httprateredis.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ func NewRedisLimitCounter(cfg *Config) (*redisCounter, error) {
}
}

if cfg.Client == nil {
if cfg.Client != nil {
rc.client = cfg.Client
} else {
maxIdle, maxActive := cfg.MaxIdle, cfg.MaxActive
if maxIdle < 1 {
maxIdle = 5
Expand Down

0 comments on commit 9136dde

Please sign in to comment.