command_builder should should allow SADD to pass an array as an argument
Closed this issue · 6 comments
Using 0.11.2 when using the SADD
command, if I pass an array as an argument I get this error: Unsupported command argument type: Array because he argument validation in command_builder does not allow this.
Fix is trivial. PR to follow.
Would you mind showing the code that cause this error?
>> RedisClient.new.call("SADD", "set", ["a", "b"])
=> 2
The above works just fine, so I assume you have deeply nested arrays? If so they're rejected on purpose.
Its coming from sidekiq-batch
on this line
https://github.com/breamware/sidekiq-batch/blob/master/lib/sidekiq/batch.rb#L99
Oh maybe you're right. They might be placing their array of job ids in an array. In fact they made this change recently on Sep 28.
Yup, they should flatten that.
The reason I don't want to allow nested arrays is that most of the time it's not intended. redis-client
tries to be strict to avoid silent issues.
Thanks @casperisfine. I'll take this up with sidekiq-batch