For performance improvements, I have used the Redis pipeline instead of single insertions. Please find the code snippet for the same.
r = redis.Redis(connection_pool=redis_pool)
r_pipeline = r.pipeline()
for key in keys:
r_pipeline.hincrby(key, hash, amount)
r_pipeline.expire(key, Globals.Cache.ttl)
return r_pipeline.execute()
the return value of r_pipeline.execute() is a list. Based on the documentation it supposes to increment and return the incremented value. But sometimes it is actually returning the value and sometimes it is just returning True.
I have gone through the documentation and did google but still not able to figure out why hincrby is returning True in the pipeline.
Can someone please help.
Comment From: itamarhaber
Hello @tirupathiraop
Keep in mind that this issue tracker should be used for reporting bugs or proposing improvements to the Redis server. This issue appears to belong to https://github.com/andymccurdy/redis-py - kindly close it and reopen there.
Note: this behavior is indeed unexpected.
Comment From: itamarhaber
This issue will now be closed - please feel free to reopen if needed.