Skip to content

Commit 9abdd68

Browse files
committed
Unlock directory before return in case of symlink
1 parent bdd7728 commit 9abdd68

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stream.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ function stream(source, res) {
392392
work.finishQueueCallback = false
393393
util.writeLockFile(streamdir, work, function (success) {
394394
if (!success) {
395-
log.logres("Could not lock streamdir.", work.options, "stream")
395+
log.logres("Could not write lock " + streamdir, work.options, "stream")
396396
return
397397
}
398398
util.writeLockFile(streamfilepart, work, function (success) {
@@ -429,7 +429,7 @@ function stream(source, res) {
429429

430430
var files = fs.readdirSync(streamdir)
431431

432-
log.logres("Found " + files.length + " files", res.options, "stream")
432+
log.logres("Found " + files.length + " file(s)", res.options, "stream")
433433

434434
if (files.length != N) {
435435
log.logres("Not creating concatenated gzip stream file."
@@ -474,6 +474,7 @@ function stream(source, res) {
474474
function (exists) {
475475
if (exists) {
476476
log.logres("Symlink from single stream part to cat file exists. Not re-creating", work.options, "stream")
477+
util.writeUnlockFile(streamdir, work, function () {})
477478
return
478479
}
479480

@@ -493,7 +494,7 @@ function stream(source, res) {
493494
}
494495
if (stderr) {
495496
log.logc(stderr, 160)
496-
}
497+
}
497498
util.writeUnlockFile(streamdir, work, function () {})
498499
})
499500
}

0 commit comments

Comments
 (0)