From 29813e485d8dc234d3a1e7ae599f090cad9de9d2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 6 Sep 2019 15:03:42 +0200 Subject: [PATCH] add a little debugging info to batch-read --- lib/batch-read.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/batch-read.js b/lib/batch-read.js index 66f106c54..3e729e66d 100644 --- a/lib/batch-read.js +++ b/lib/batch-read.js @@ -39,7 +39,7 @@ read('./pewpew.txt', function (err, data) { */ -module.exports = function () { +module.exports = function (/* task */) { var map = {}; return function (id, cb, impl) { if (typeof(cb) !== 'function' || typeof(impl) !== 'function') { @@ -49,6 +49,9 @@ module.exports = function () { map[id] = [cb]; impl(function () { var args = Array.prototype.slice.call(arguments); + + //if (map[id] && map[id].length > 1) { console.log("BATCH-READ DID ITS JOB for [%s][%s]", task, id); } + map[id].forEach(function (h) { h.apply(null, args); });