chaps-io / gush

Fast and distributed workflow runner using ActiveJob and Redis
MIT License
1.03k stars 103 forks source link

Use Redis#exists? in Gush::Client.next_free_workflow_id #83

Closed fred-tyemill closed 2 years ago

fred-tyemill commented 3 years ago

Noticed this warning popping up after upgrading the redis Gem from 3.3.5 to 4.2.2.

`Redis#exists(key)` will return an Integer in redis-rb 4.3. `exists?` returns a boolean, you should use it instead. To opt-in to the new behavior now you can set Redis.exists_returns_integer =  true. To disable this message and keep the current (boolean) behaviour of 'exists' you can set `Redis.exists_returns_integer = false`, but this option will be removed in 5.0.

This change suppresses the warning and better prepares gush for redis 5.0.

fred-tyemill commented 3 years ago

Looks like for this change to work in CI, the fakeredis Gem needs to support the new method. I have a pull request out for that project and verified tests pass with a fork of it: https://github.com/guilleiguaran/fakeredis/pull/257

joshRpowell commented 3 years ago

another approach https://github.com/ondrejbartas/sidekiq-cron/pull/288

pokonski commented 2 years ago

I got rid of fake redis and decided to use actual Redis instance on CI and locally, so this is no longer needed. Thanks!