Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
jeromy-cannon committed Sep 12, 2024
1 parent 860e4b5 commit c3934c0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/k8.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -579,16 +579,15 @@ export class K8 {
let additionalErrorMessageDetail = ''

// Use pipe() to automatically handle backpressure between streams
outputPassthroughStream.pipe(outputFileStream);
outputPassthroughStream.pipe(outputFileStream)

outputPassthroughStream.on('data', (chunk) => {
const canWrite = outputFileStream.write(chunk); // Write chunk to file and check if buffer is full
const canWrite = outputFileStream.write(chunk) // Write chunk to file and check if buffer is full

if (!canWrite) {
console.log(`Buffer is full, pausing data stream... for copying from ${podName}:${srcDir}/${srcFile} to ${destPath}`);
outputPassthroughStream.pause(); // Pause the data stream if buffer is full
console.log(`Buffer is full, pausing data stream... for copying from ${podName}:${srcDir}/${srcFile} to ${destPath}`)
outputPassthroughStream.pause() // Pause the data stream if buffer is full
}

})

outputFileStream.on('drain', () => {
Expand Down Expand Up @@ -663,7 +662,6 @@ export class K8 {

outputFileStream.on('error', (err) => {
return reject(new FullstackTestingError(`writerStream error encountered copying from ${podName}:${srcDir}/${srcFile} to ${destPath}, err: ${err.toString()}`, err))

})

outputFileStream.on('end', () => {
Expand Down

0 comments on commit c3934c0

Please sign in to comment.