From ecd19e3ec68d47e9846a4db957220269567698fd Mon Sep 17 00:00:00 2001 From: Ash Monty Date: Wed, 6 Jul 2022 11:24:08 +0200 Subject: [PATCH] fix: trello failing on degraded service --- src/trello.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/trello.js b/src/trello.js index bd671b5..cd8e6f9 100644 --- a/src/trello.js +++ b/src/trello.js @@ -9,10 +9,7 @@ let cache; async function getTrelloCache() { const available = await trelloAPIAvailable(); if (!available) { - return { - update_time: Date.now(), - sections: [] - }; + return cache; } if (!cache) { @@ -79,7 +76,7 @@ async function updateTrelloCache() { async function trelloAPIAvailable() { const { status } = await got('https://trello.status.atlassian.com/api/v2/status.json').json(); - return status.description === 'All Systems Operational'; + return status.indicator !== 'major' && status.indicator !== 'critical'; } module.exports = {