From a2ac1ed9a713f98ee63904878062fc10cb0df1e9 Mon Sep 17 00:00:00 2001 From: stickykeys <8445610+v-stickykeys@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:44:59 -0500 Subject: [PATCH] temp: send discord messages for start and exit for all envs (#526) * temp: send dev discord messages for start and exit * fix: send discord messages to all envs --- runner/check-aws-ecs-tasks.js | 8 +++----- runner/report-exit.js | 30 ++++++++++++++---------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/runner/check-aws-ecs-tasks.js b/runner/check-aws-ecs-tasks.js index a4d8d77eb..20ce4bc5e 100644 --- a/runner/check-aws-ecs-tasks.js +++ b/runner/check-aws-ecs-tasks.js @@ -12,11 +12,9 @@ async function main() { } else { console.log('OK') console.log('Only one running task found (assumed to be self)') - if (process.env.AWS_ECS_CLUSTER.includes('prod')) { - // Only do this in prod because it's too noisy given the short interval of - // tnet and dev anchoring - sendStartNotification(taskArns) - } + // Only do this in prod because it's too noisy given the short interval of + // tnet and dev anchoring + sendStartNotification(taskArns) } } diff --git a/runner/report-exit.js b/runner/report-exit.js index 03421caac..189e9a8b9 100644 --- a/runner/report-exit.js +++ b/runner/report-exit.js @@ -1,22 +1,20 @@ const { generateDiscordCloudwatchFields, sendDiscordNotification, listECSTasks } = require('./helpers') async function main() { - if (process.env.AWS_ECS_CLUSTER.includes('prod')) { - // Only do this in prod because it's too noisy given the short interval of - // tnet and dev anchoring - const taskArns = await listECSTasks() - const fields = generateDiscordCloudwatchFields(taskArns) - const message = [ - { - title: `CAS anchor task finished (${process.env.AWS_ECS_CLUSTER})`, - color: 3447003, // Blue - fields, - }, - ] - const data = { embeds: message, username: 'cas-runner' } - const retryDelayMs = 300000 // 300k ms = 5 mins - sendDiscordNotification(process.env.DISCORD_WEBHOOK_URL_INFO_CAS, data, retryDelayMs) - } + // Only do this in prod because it's too noisy given the short interval of + // tnet and dev anchoring + const taskArns = await listECSTasks() + const fields = generateDiscordCloudwatchFields(taskArns) + const message = [ + { + title: `CAS anchor task finished (${process.env.AWS_ECS_CLUSTER})`, + color: 3447003, // Blue + fields, + }, + ] + const data = { embeds: message, username: 'cas-runner' } + const retryDelayMs = 300000 // 300k ms = 5 mins + sendDiscordNotification(process.env.DISCORD_WEBHOOK_URL_INFO_CAS, data, retryDelayMs) } main()