提交 520d075e 编写于 作者: S Sandeep Somavarapu

Log as soon as an entry is called

上级 40515c5a
...@@ -101,16 +101,16 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, log ...@@ -101,16 +101,16 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, log
if (isCanceled || zipfile.entryCount === extractedEntriesCount) { if (isCanceled || zipfile.entryCount === extractedEntriesCount) {
c(null); c(null);
} else { } else {
e(new ExtractError('Incomplete', new Error(nls.localize('incompleteExtract', "Incomplete. Extracted {0} of {1} entries", extractedEntriesCount, zipfile.entryCount)))); e(new ExtractError('Incomplete', new Error(nls.localize('incompleteExtract', "Incomplete. Found {0} of {1} entries", extractedEntriesCount, zipfile.entryCount))));
} }
}, e)); }, e));
zipfile.on('entry', (entry: Entry) => { zipfile.on('entry', (entry: Entry) => {
logService.debug(targetPath, 'Found', entry.fileName);
if (isCanceled) { if (isCanceled) {
return; return;
} }
logService.debug(targetPath, 'Extracting', entry.fileName);
if (!options.sourcePathRegex.test(entry.fileName)) { if (!options.sourcePathRegex.test(entry.fileName)) {
extractedEntriesCount++; extractedEntriesCount++;
return; return;
...@@ -131,6 +131,7 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, log ...@@ -131,6 +131,7 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions, log
last = throttler.queue(() => stream.then(stream => extractEntry(stream, fileName, mode, targetPath, options).then(() => extractedEntriesCount++))); last = throttler.queue(() => stream.then(stream => extractEntry(stream, fileName, mode, targetPath, options).then(() => extractedEntriesCount++)));
}); });
}, () => { }, () => {
logService.debug(targetPath, 'Cancelled.');
isCanceled = true; isCanceled = true;
last.cancel(); last.cancel();
zipfile.close(); zipfile.close();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册