Skip to content

Commit

Permalink
fix: 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 711fd01 commit 8059674
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/app/modules/submission/submission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ export const downloadCleanFile = (cleanFileKey: string, versionId: string) => {
message: 'Successfully downloaded file from S3',
meta: logMeta,
})
resolve(buffer)
})
const timeDownloadEnd = Date.now()
const timeDownloadEnd = Date.now()
logger.info({
message: 'Duration of file download from S3',
meta: { ...logMeta, time: timeDownloadEnd - timeDownloadStart },
})

logger.info({
message: 'Duration of file download from S3',
meta: { ...logMeta, time: timeDownloadEnd - timeDownloadStart },
resolve(buffer)
})

readStream.on('error', (error) => {
Expand All @@ -426,14 +426,6 @@ export const downloadCleanFile = (cleanFileKey: string, versionId: string) => {
)
}

// statsdClient.distribution(
// 'formsg.submissions.virusScanFile.duration',
// duration,
// {
// rating: `${rating}`,
// },
// )

/**
* Helper function to trigger virus scanning and download clean file.
* @param response quarantined attachment response from storage submissions v2.1+.
Expand Down

0 comments on commit 8059674

Please sign in to comment.