From b4b68498cde658f6e6a4537f4732a786b0c01ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 23 Jun 2017 17:17:27 -0400 Subject: [PATCH] added interval option to processSortedSet --- src/batch.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/batch.js b/src/batch.js index 9a0271f29b..204ae79940 100644 --- a/src/batch.js +++ b/src/batch.js @@ -63,7 +63,11 @@ exports.processSortedSet = function (setKey, process, options, callback) { start += utils.isNumber(options.alwaysStartAt) ? options.alwaysStartAt : batch + 1; stop = start + batch; - next(); + if (options.interval) { + setTimeout(next, options.interval); + } else { + next(); + } }); }); },