node-redisscan
node-redisscan copied to clipboard
Possible Improvements with retrieving list values
I noticed in your script whenever a scan query finds a list type, the length of the list is grabbed, and the values are pulled index by index. https://github.com/fritzy/node-redisscan/blob/master/index.js#L57
There is a redis command LRANGE which can pull a range of values from the list, and would reduce the queries submitted to redis if the LRANGE were to pull index's 0 to -1 (all records) or possibly split the length out into sets of 10, 20, etc and pass an array into the callback, or split the array and pass each value to the callback to maintain current syntax.
I'm curious to know if this was an oversight, or there is a reason behind using LINDEX over LRANGE. Only concern behind LRANGE I can imagen is if the list is HUGE in redis, a reply may never be received due to the mass amounts of data to process, causing the socket to timeout, which splitting into sets would avoid.
A fork will be made.
Your fork has proved to be much more stable when scanning large amounts of values (500+). The current command often leads to objects being "skipped" when working with large value sets that are updated often.