gosexy / redis

Redis client for Go that maps the full redis command list into equivalent Go functions.
MIT License
167 stars 44 forks source link

Fix BLPOP and BRPOP arguments constructing #5

Closed syhpoon closed 11 years ago

syhpoon commented 11 years ago

BLPOP and BRPOP commands do not correctly construct their arguments. The i variable is not getting increased in the range loop and timeout arg is getting placed in the first position instead of the last.

xiam commented 11 years ago

Thanks, looks odd, the i variable should start on 0 up to len(keys), so I don't catch why you're having problems. Allow me some time to check this commit.

syhpoon commented 11 years ago

You could try to perform the following command:

client.BLPop(0, "test") and watch the redis-cli monitor output. It will receive: "BLPOP" "0" ""

xiam commented 11 years ago

Of course! the variable i on the for cycle was in its own scope, so the var i was never updated. Thanks!