Remove eventEmitter warning
This commit is contained in:
parent
16d18f23a1
commit
2eccc86e83
@ -130,6 +130,7 @@ async function unzip(zipFile: string, dir: string, archiveDir?: string): Promise
|
|||||||
// Pull the file out of the archive, write it to the target directory
|
// Pull the file out of the archive, write it to the target directory
|
||||||
const input = createRecordReadStream();
|
const input = createRecordReadStream();
|
||||||
const output = createWriteStream(filePath);
|
const output = createWriteStream(filePath);
|
||||||
|
output.setMaxListeners(Infinity);
|
||||||
output.on("error", e => reject(Object.assign(e, { filePath })));
|
output.on("error", e => reject(Object.assign(e, { filePath })));
|
||||||
output.on("finish", () => resolve(filePath));
|
output.on("finish", () => resolve(filePath));
|
||||||
input.pipe(output);
|
input.pipe(output);
|
||||||
@ -166,6 +167,7 @@ async function readFileChunk(file: string, start: number, end: number): Promise<
|
|||||||
const chunks: Buffer[] = [];
|
const chunks: Buffer[] = [];
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const stream = createReadStream(file, { start, end });
|
const stream = createReadStream(file, { start, end });
|
||||||
|
stream.setMaxListeners(Infinity);
|
||||||
stream.on("error", e => reject(e));
|
stream.on("error", e => reject(e));
|
||||||
stream.on("end", () => resolve(Buffer.concat(chunks)));
|
stream.on("end", () => resolve(Buffer.concat(chunks)));
|
||||||
stream.on("data", chunk => chunks.push(chunk as Buffer));
|
stream.on("data", chunk => chunks.push(chunk as Buffer));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user