resque icon indicating copy to clipboard operation
resque copied to clipboard

TypeError: can't convert Redis::Future into an exact number

Open jcoyne opened this issue 4 years ago • 2 comments

When using ActiveSupport 7.0.1 with resque, a type error is raised:

TypeError: can't convert Redis::Future into an exact number
Original Exception (TypeError): can't convert Redis::Future into an exact number
  /opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.1/lib/active_support/core_ext/time/calculations.rb:56:in `at'  
/opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/activesupport-7.0.1/lib/active_support/core_ext/time/calculations.rb:56:in `at_with_coercion'  
/opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/resque-2.2.0/lib/resque/data_store.rb:95:in `server_time'  
/opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/resque-2.2.0/lib/resque/worker.rb:483:in `heartbeat!'  
/opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/resque-2.2.0/lib/resque/worker.rb:520:in `block (2 levels) in start_heartbeat'  
/opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/resque-2.2.0/lib/resque/worker.rb:519:in `loop'  
/opt/app/lyberadmin/common-accessioning/shared/bundle/ruby/3.0.0/gems/resque-2.2.0/lib/resque/worker.rb:519:in `block in start_heartbeat'

jcoyne avatar Feb 09 '22 16:02 jcoyne

Same error here, resque v2.0.0 & ActiveSupport 6.1.5.1

can't convert Redis::Future into an exact number Original Exception (TypeError): can't convert Redis::Future into an exact number /srv/xxx/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.5.1/lib/active_support/core_ext/time/calculations.rb:56:in at' /srv/xxx/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.5.1/lib/active_support/core_ext/time/calculations.rb:56:in at_with_coercion' /srv/xxx/vendor/bundle/ruby/2.6.0/gems/resque-2.0.0/lib/resque/data_store.rb:94:in server_time' /srv/xxx/vendor/bundle/ruby/2.6.0/gems/resque-2.0.0/lib/resque/worker.rb:478:in heartbeat!' /srv/xxx/vendor/bundle/ruby/2.6.0/gems/resque-2.0.0/lib/resque/worker.rb:513:in block (2 levels) in start_heartbeat' /srv/xxx/vendor/bundle/ruby/2.6.0/gems/resque-2.0.0/lib/resque/worker.rb:512:in loop' /srv/xxx/vendor/bundle/ruby/2.6.0/gems/resque-2.0.0/lib/resque/worker.rb:512:in `block in start_heartbeat'

vhazbun avatar Aug 24 '22 18:08 vhazbun

Check the output

Resque.redis.time

it should be an array with two numbers. In my case it was nil because of broken configuration

andriy-baran avatar Jan 11 '24 10:01 andriy-baran