From 2edfd1fad55dd0fe3a9c7709efb1b98193f8e8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 29 Mar 2017 19:51:19 +0200 Subject: [PATCH] Compare interger instead of strings --- batch/pubsub/queue-seeker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/batch/pubsub/queue-seeker.js b/batch/pubsub/queue-seeker.js index f220a761..46ed0c6f 100644 --- a/batch/pubsub/queue-seeker.js +++ b/batch/pubsub/queue-seeker.js @@ -43,7 +43,8 @@ QueueSeeker.prototype._seek = function (client, cursor, users, attemps, callback }); } - var hasMore = currentCursor[0] !== '0' && attemps < MAX_SCAN_ATTEMPTS; + var hasMore = (parseInt(currentCursor[0], 10) > 0) && (attemps < MAX_SCAN_ATTEMPTS); + if (!hasMore) { return callback(null, users); }