Fix shadow of pipeline variable
This commit is contained in:
@@ -48,15 +48,15 @@ async function addFile(sourceFile, encryption, uploader, progressCallback) {
|
||||
const hash = new HashStream();
|
||||
const destStream = uploader.createStream();
|
||||
|
||||
let pipeline;
|
||||
let pipelinePromise;
|
||||
if (encryption) {
|
||||
const encryptStream = new EncryptStream(encryption);
|
||||
pipeline = safe(pipeline(sourceStream, encryptStream, ps, hash, destStream));
|
||||
pipelinePromise = pipeline(sourceStream, encryptStream, ps, hash, destStream);
|
||||
} else {
|
||||
pipeline = safe(pipeline(sourceStream, ps, hash, destStream));
|
||||
pipelinePromise = pipeline(sourceStream, ps, hash, destStream);
|
||||
}
|
||||
|
||||
const [error] = await safe(pipeline);
|
||||
const [error] = await safe(pipelinePromise);
|
||||
if (error && !error.message.includes('ENOENT')) throw new BoxError(BoxError.EXTERNAL_ERROR, `tarPack pipeline error: ${error.message}`); // ignore error if file disappears
|
||||
// debug(`addFile: pipeline finished: ${JSON.stringify(ps.stats())}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user