Skip to content

Commit 4b8411b

Browse files
committed
Use standard handleResponse method and ensure pool connections are released on error.
1 parent 0016edc commit 4b8411b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ function redisStore(args) {
365365
(function nextBatch(cursorId) {
366366
conn.scan(cursorId, 'match', pattern, 'count', scanCount, function (err, result) {
367367
if (err) {
368-
return cb && cb(err);
368+
handleResponse(conn, cb)(err);
369369
}
370370

371371
var nextCursorId = result[0];
@@ -379,8 +379,7 @@ function redisStore(args) {
379379
return nextBatch(nextCursorId);
380380
}
381381

382-
pool.release(conn);
383-
return cb && cb(null, Object.keys(keysObj));
382+
handleResponse(conn, cb)(null, Object.keys(keysObj));
384383
});
385384
})(0);
386385
});

0 commit comments

Comments
 (0)