Skip to content

Commit

Permalink
Rename RateLimitTimeWindow to RateLimitTimeWindowMs
Browse files Browse the repository at this point in the history
  • Loading branch information
denistakeda committed Apr 3, 2023
1 parent da9d33c commit b8213c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/static/default-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ HTTPSBackendIgnoreCert = true
RateLimit = 0

# Value in milliseconds
RateLimitTimeWindow = 1000
RateLimitTimeWindowMs = 1000

# The number of requests per host that can be handled in paralles. The default value 0
# means the value will be the same as RateLimit
Expand Down
4 changes: 2 additions & 2 deletions internal/proxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Config struct {
HTTPSBackendIgnoreCert bool
EnableAccessLog bool
RateLimit int
RateLimitTimeWindow int
RateLimitTimeWindowMs int
RateLimitBurst int
RateLimitCacheSize int
}
Expand All @@ -48,7 +48,7 @@ func (c *Config) Apply(ctx context.Context, p *HTTPProxy) error {

rateLimiter, resErr := NewRateLimiter(RateLimitParams{
RateLimit: c.RateLimit,
TimeWindow: time.Duration(c.RateLimitTimeWindow) * time.Millisecond,
TimeWindow: time.Duration(c.RateLimitTimeWindowMs) * time.Millisecond,
Burst: c.RateLimitBurst,
CacheSize: c.RateLimitCacheSize,
})
Expand Down

0 comments on commit b8213c1

Please sign in to comment.