fix: trello failing on degraded service

This commit is contained in:
Ash Monty
2022-07-06 11:24:08 +02:00
parent 17d404870f
commit ecd19e3ec6

View File

@@ -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 = {