Skip to content

Commit

Permalink
chore: add logs for virus scanning duration
Browse files Browse the repository at this point in the history
  • Loading branch information
kathleenkhy committed Mar 7, 2024
1 parent 48376b6 commit 41cbe5a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/modules/submission/submission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,20 @@ export const downloadCleanFile = (cleanFileKey: string, versionId: string) => {
})
.createReadStream()

logger.info({
message: 'File download from S3 has started',
meta: logMeta,
})

readStream.pipe(writeStream)

return ResultAsync.fromPromise(
new Promise<Buffer>((resolve, reject) => {
readStream.on('end', () => {
logger.info({
message: 'Successfully downloaded file from S3',
meta: logMeta,
})
resolve(buffer)
})

Expand Down

0 comments on commit 41cbe5a

Please sign in to comment.