ExHammer / hammer

An Elixir rate-limiter with pluggable backends
https://hexdocs.pm/hammer/
MIT License
749 stars 42 forks source link

ArgumentError from Hammer.check_rate/3 #23

Closed nallwhy closed 6 years ago

nallwhy commented 6 years ago

I met ArgumentError frequently.

** (CaseClauseError) no case clause matching: {:error, %ArgumentError{message: "argument error"}}

When call_backend/3 returns {:error, _}, check_rate/4 returns {:error, _}.

I guess it's because of lack of pool.

JuneKelly commented 6 years ago

Hi, thanks for the bug report.

Could you try upgrading to the newest version (5.0.0) of both hammer and hammer_backend_redis (if applicable) and see if that helps? There are quite a few bug-fixes in the last few releases, and the current version should be much more stable than old versions.

nallwhy commented 6 years ago

It is still not working. But with more max pool size, it works.

JuneKelly commented 6 years ago

Cool, glad that works.

Out of interest, what size are you setting the pool to? Curious to know at what scale the default stops being sufficient.