1
0
Fork 0

Removing extra logs

pull/1700/head
Vallie Joseph 2024-04-01 20:14:07 +00:00
parent a926fff385
commit 84d3cef541
1 changed files with 1 additions and 47 deletions

View File

@ -42,47 +42,6 @@ export async function createZipUploadStream(
zip.on('warning', zipWarningCallback) zip.on('warning', zipWarningCallback)
zip.on('finish', zipFinishCallback) zip.on('finish', zipFinishCallback)
zip.on('end', zipEndCallback) zip.on('end', zipEndCallback)
// for (const file of uploadSpecification) {
// await new Promise((resolve, reject) => {
// if (file.sourcePath !== null) {
// core.debug(`createReadStream with: ${file.sourcePath}`)
// // Add a normal file to the zip
// const readStream = createReadStream(file.sourcePath)
// readStream.on('data', chunk => {
// core.debug(`Received ${chunk.length} bytes of data.`)
// })
// readStream.on('end', () => {
// core.debug('There will be no more data.')
// })
// readStream.on('error', reject) // Catch any errors from createReadStream
// core.debug(`readsstream errors: ${readStream.errored}`)
// const entry = zip.entry(
// readStream,
// {name: file.destinationPath},
// function (err) {
// core.debug(`Is stream paused: ${readStream.isPaused()}`)
// if (err) {
// core.error('An error occurred:', err)
// reject(err)
// }
// core.debug(`Is stream paused: ${readStream.isPaused()}`)
// resolve('resolved artifact')
// }
// )
// readStream.pipe(entry)
// } else {
// zip.entry(null, {name: `${file.destinationPath}/`}, function (err) {
// if (err) {
// core.error('An error occurred:', err)
// reject(err)
// }
// resolve('resolved artifact')
// })
// }
// })
// }
// see https://caolan.github.io/async/v3/docs.html#queue for options // see https://caolan.github.io/async/v3/docs.html#queue for options
const fileUploadQueue = async.queue(function (task, callback) { const fileUploadQueue = async.queue(function (task, callback) {
core.debug(`adding file to upload queue ${task}`) core.debug(`adding file to upload queue ${task}`)
@ -96,22 +55,17 @@ export async function createZipUploadStream(
for (const file of uploadSpecification) { for (const file of uploadSpecification) {
if (file.sourcePath !== null) { if (file.sourcePath !== null) {
const readStream = createReadStream(file.sourcePath) const readStream = createReadStream(file.sourcePath)
readStream.on('data', chunk => {
core.debug(`Received ${chunk.length} bytes of data.`)
})
readStream.on('end', () => { readStream.on('end', () => {
core.debug('There will be no more data.') core.debug('The upload read stream is ending')
}) })
readStream.on('error', function (err) { readStream.on('error', function (err) {
core.debug(`${err}`) core.debug(`${err}`)
}) // Catch any errors from createReadStream }) // Catch any errors from createReadStream
fileUploadQueue.push( fileUploadQueue.push(
zip.entry(readStream, {name: file.destinationPath}, function (err) { zip.entry(readStream, {name: file.destinationPath}, function (err) {
core.debug(`Is stream paused: ${readStream.isPaused()}`)
if (err) { if (err) {
core.error('An error occurred:', err) core.error('An error occurred:', err)
} }
core.debug(`Is stream paused: ${readStream.isPaused()}`)
}) })
) )
} else { } else {