We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying the prorate gem, I'm running into redis error:
require "prorate" require "async" Async do |task| 11.times do |i| task.async do t = Prorate::Throttle.new( redis: $redis, logger: Rails.logger, name: "throttler", limit: 10, period: 1, block_for: 0.5 ) t << "counter" t.throttle! end end end.wait
Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler Applying throttle counter throttler 8m error: Async::Task [oid=0xaca8] [ec=0xacbc] [pid=742358] [2022-03-22 15:57:27 +0100] | Redis::CommandError: ERR Error running script (call to f_18f5304b307c1151f10cef5f9757e8cf742c37b7): @user_script:51: ERR value is not an integer or out of range | → /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/redis-4.6.0/lib/redis/client.rb:162 in `call' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/redis-4.6.0/lib/redis.rb:263 in `block in send_command' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/redis-4.6.0/lib/redis.rb:262 in `synchronize' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/redis-4.6.0/lib/redis.rb:262 in `send_command' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/redis-4.6.0/lib/redis/commands/scripting.rb:110 in `_eval' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/redis-4.6.0/lib/redis/commands/scripting.rb:97 in `evalsha' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/prorate-0.7.1/lib/prorate/throttle.rb:146 in `block in run_lua_throttler' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/prorate-0.7.1/lib/prorate/null_pool.rb:4 in `with' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/prorate-0.7.1/lib/prorate/throttle.rb:144 in `run_lua_throttler' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/prorate-0.7.1/lib/prorate/throttle.rb:91 in `throttle!' | (irb):211 in `block (3 levels) in <top (required)>' | /home/wojtek/.asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/async-2.0.1/lib/async/task.rb:258 in `block in schedule'
so it throws out when it should throttle (on the 11 call). Do you know what could be the cause?
The text was updated successfully, but these errors were encountered:
Hey @morgoth 👋
I suspect the :block_for value has to be an integer, not a float. Could you try?
:block_for
Sorry, something went wrong.
yes, this is it. So it is not possible to block for less time than 1s?
No branches or pull requests
When trying the prorate gem, I'm running into redis error:
so it throws out when it should throttle (on the 11 call).
Do you know what could be the cause?
The text was updated successfully, but these errors were encountered: