Upgrade Redis gem to 4.8.0
What does this MR do and why?
This upgrade adds deprecations to help us transition to redis-rb 5.0: https://github.com/redis/redis-rb/pull/1134/files
https://my.diffend.io/gems/redis/4.7.1/4.8.0
https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#480
There are multiple ways to address the deprecation for sadd
/ srem
:
-
We could just set
Redis.sadd_returns_boolean = false
so that we switch to the new redis-rb 5.0 behavior. All of the usages I found in our codebase don't really care about the return value so in theory this should work. This is riskier though because there could be some gems that depend on these commands returning booleans. -
Change calls that pass a non-array value to use
sadd?
/srem?
. This prevents the deprecation message and keeps the old behavior. -
Change calls that pass a non-array value to pass an array instead. Passing an array always returns an integer (the number of members added / removed). This is similar to 1 but only affects the calls that we change.
I went with a combination of 2 and 3 because it's less risky. This gives us time to see if there are any deprecated usage in gems. In some places I used approach 3 because we were already looping over an array and it would be more efficient to use a single command. The return value isn't being used anyway so it should work the same way.
Regarding the timeout
deprecation, I don't see any usage of this in this repo.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.