Skip to content

Commit

Permalink
Update Lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Dec 19, 2024
1 parent ab5a757 commit 80ffc99
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions api/lib/aws/alarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,20 @@ export default class Alarm {
MetricAlarms.push(...(res.MetricAlarms || []));
} while (res.NextToken)

if (!res.MetricAlarms.length) return 'unknown';
if (!MetricAlarms.length) return 'unknown';

let final;
for (const alarm of (MetricAlarms || [])) {
let value = 'healthy';
if (alarm.StateValue === 'ALARM') value = 'alarm';
if (alarm.StateValue === 'INSUFFICIENT_DATA') value = 'unknown';

const layer = parseInt(String(alarm.AlarmName).replace(`${this.stack}-layer-`, ''));

if (!final || final === 'health' && value === 'alarm') {
final = value
}
}

return final;
return final || 'unknown';
} catch (err) {
throw new Err(500, new Error(err instanceof Error ? err.message : String(err)), 'Failed to describe alarm');
}
Expand Down

0 comments on commit 80ffc99

Please sign in to comment.