Skip to content

Commit

Permalink
Only warning sending
Browse files Browse the repository at this point in the history
  • Loading branch information
mj52951 committed Nov 6, 2023
1 parent a12df09 commit e66bbc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/indexer/services/monitoringService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ export async function checkTransferStatus(transferRepository: TransferRepository
for (const transfer of transfers) {
const duration = Date.now() - transfer.timestamp.getTime()
const durationInMins = convertMillisecondsToMinutes(duration)
if (durationInMins > Number(process.env.INCIDENT_TIME_MINUTES)) {
const msg = await createMessage(process.env.INCIDENT_TEMPLATE_PATH!, transfer, durationInMins)
await notificationSender.sendNotification({ Message: msg, TopicArn: process.env.TOPIC_ARN })
logger.debug("Incident sent")
} else if (durationInMins > Number(process.env.WARNING_TIME_MINUTES)) {
if (durationInMins > Number(process.env.WARNING_TIME_MINUTES)) {
const msg = await createMessage(process.env.WARNING_TEMPLATE_PATH!, transfer, durationInMins)
await notificationSender.sendNotification({ Message: msg, TopicArn: process.env.TOPIC_ARN })
logger.debug("Warning sent")
Expand Down
1 change: 1 addition & 0 deletions src/indexer/services/monitoringService/warningTemplate.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The Monitoring Service

Tags:

#type: deposit
#txHash:<%= txHash %>
#fromDomainId:<%= fromDomainId %>
#durationInMins:<%= durationInMins %>

0 comments on commit e66bbc6

Please sign in to comment.