From b63d1527a0273514a2679e35f8702d37b5fc9095 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Tue, 23 Jan 2018 18:54:52 +0100 Subject: [PATCH] Small bit of better logging --- storage/file.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/file.js b/storage/file.js index 62ed4fa39..329d7f74f 100644 --- a/storage/file.js +++ b/storage/file.js @@ -124,6 +124,7 @@ const mkBufferSplit = () => { return (abort, cb) => { read(abort, function (end, data) { if (end) { + if (data) { console.log("mkBufferSplit() Data at the end"); } cb(end, remainder ? [remainder, data] : [data]); remainder = null; return; @@ -166,7 +167,9 @@ const readMessagesBin = (env, id, start, msgHandler, cb) => { ToPull.read(stream), mkBufferSplit(), mkOffsetCounter(), - Pull.asyncMap((data, moreCb) => { msgHandler(data, moreCb, ()=>{ keepReading = false; moreCb(); }); }), + Pull.asyncMap((data, moreCb) => { + msgHandler(data, moreCb, () => { keepReading = false; moreCb(); }); + }), Pull.drain(() => (keepReading), (err) => { cb((keepReading) ? err : undefined); })