Skip to content

Commit

Permalink
fix: rate limiter config
Browse files Browse the repository at this point in the history
  • Loading branch information
gussf committed Jun 5, 2024
1 parent 48cbec3 commit f4a23b6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ feedbackListeners:
rateLimiter:
limit: 100
redis:
host: "localhost:6379"
pwd: ""
host: "localhost"
port: "6379"
password: ""
2 changes: 1 addition & 1 deletion config/docker_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ rateLimiter:
limit: 100
redis:
host: "redis:6379"
pwd: ""
password: ""
5 changes: 3 additions & 2 deletions config/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,6 @@ feedbackListeners:
rateLimiter:
limit: 100
redis:
host: "localhost:6379"
pwd: ""
host: "localhost"
port: "6379"
password: ""
4 changes: 3 additions & 1 deletion extensions/rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ type rateLimiter struct {
}

func NewRateLimiter(config *viper.Viper, logger *logrus.Logger) rateLimiter {
addr := config.GetString("rateLimiter.redis.host")
host := config.GetString("rateLimiter.redis.host")
port := config.GetString("rateLimiter.redis.port")
pwd := config.GetString("rateLimiter.redis.password")
limit := config.GetInt("rateLimiter.limit")

addr := fmt.Sprintf("%s:%s", host, port)
rdb := redis.NewClient(&redis.Options{
Addr: addr,
Password: pwd,
Expand Down

0 comments on commit f4a23b6

Please sign in to comment.