juspay / fencer

Fencer is a port of https://github.com/lyft/ratelimit into Haskell.
https://hub.docker.com/r/juspayin/fencer
Other
9 stars 2 forks source link

Issue #26: Handling duplicate domains #103

Closed mdimjasevic closed 4 years ago

mdimjasevic commented 4 years ago

This patch answers the following question from issue #26: "What happens when configuration contains duplicate domains?" Ratelimit errors with a log message such as:

ERRO[0000] error loading new configuration from runtime: config.another.yaml: duplicate domain 'another' in config file

When a request is submitted to it, it responds with:

ERROR:
  Code: Unknown
  Message: no rate limit configuration loaded

This patch updates Fencer to match the behavior.

Note that I used some functionality from the mdimjasevic/26-cant-read-file branch, hence this PR's branch is based on that branch. In other words, please review PR #102 first.