diff --git a/src/cdn/funcs/saveResponse.ts b/src/cdn/funcs/saveResponse.ts index 2509d77..896c80b 100644 --- a/src/cdn/funcs/saveResponse.ts +++ b/src/cdn/funcs/saveResponse.ts @@ -58,7 +58,7 @@ export default function saveResponse( //TODO: need to automatically delete file once it is no longer used //TODO: need to provide methods to seek through file return resolve(tempFileName); - //const stream = fs.createReadStream(tempFileName, { encoding: 'binary' }); //TODO: we may need to remove encoding since mentioning encoding automatically switches to string format + //const stream = fs.createReadStream(tempFileName); //return resolve(stream); }); } diff --git a/src/ssn/streams/getFileFromDisks.ts b/src/ssn/streams/getFileFromDisks.ts index 0d1f3ae..4b87b50 100644 --- a/src/ssn/streams/getFileFromDisks.ts +++ b/src/ssn/streams/getFileFromDisks.ts @@ -28,6 +28,7 @@ export default function getFileFromDisks(disks: string[], { diskStart, offset, s if (chunk === null) { curDiskIndex += 1; curDisk = getStream(disks, curDiskIndex, 0); + //await new Promise((resolve) => { curDisk.on('readable', () => { resolve(); }); }); return curDisk.read(num); } else { return chunk;