Skip to content

Commit

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

const timeDownloadStart = Date.now()
logger.info({
message: 'File download from S3 has started',
meta: logMeta,
Expand All @@ -399,6 +400,12 @@ export const downloadCleanFile = (cleanFileKey: string, versionId: string) => {
message: 'Successfully downloaded file from S3',
meta: logMeta,
})
const timeDownloadEnd = Date.now()
logger.info({
message: 'File download from S3 duration',
meta: { ...logMeta, time: timeDownloadEnd - timeDownloadStart },
})

resolve(buffer)
})

Expand Down

0 comments on commit 5c1dd76

Please sign in to comment.