Skip to content

Commit 4346329

Browse files
sanji-programmersanji-programmerctalkington
authoredMar 19, 2020
fix for a hang with _statQueue (#388)
* fix for a hang with _statQueue * Update package-lock.json Co-authored-by: sanji-programmer <sanji-programmer@mail.com> Co-authored-by: Chris Talkington <chris@talkingtontech.com>
1 parent 227b785 commit 4346329

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
 

‎lib/core.js

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var Archiver = function(format, options) {
5353
this._queue.drain = this._onQueueDrain.bind(this);
5454

5555
this._statQueue = async.queue(this._onStatQueueTask.bind(this), options.statConcurrency);
56+
this._statQueue.drain = this._onQueueDrain.bind(this);
5657

5758
this._state = {
5859
aborted: false,

‎test/archiver.js

+17
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,23 @@ describe('archiver', function() {
371371
.file('test/fixtures/empty.txt')
372372
.finalize()
373373
});
374+
375+
it('should allow continue on with several stat failings', function(done) {
376+
archive = archiver('json');
377+
var testStream = new WriteStream('tmp/errors-stat.json');
378+
379+
testStream.on('close', function() {
380+
done();
381+
});
382+
383+
archive.pipe(testStream);
384+
385+
archive.file('test/fixtures/test.txt');
386+
for (var i = 1; i <= 20; i++)
387+
archive.file('test/fixtures/test-missing.txt');
388+
389+
archive.finalize()
390+
});
374391
});
375392
});
376393
});

0 commit comments

Comments
 (0)
Please sign in to comment.