mirror of
https://github.com/rajnandan1/kener.git
synced 2026-01-05 17:10:04 -06:00
refactor: improve downtime duration calculation in closure comment #387
This commit is contained in:
@@ -104,7 +104,7 @@ async function closeIncident(alert, comment) {
|
||||
|
||||
function createClosureComment(alert, commonJSON) {
|
||||
let comment = "The incident has been auto resolved";
|
||||
let downtimeDuration = moment(alert.updated_at).diff(moment(alert.created_at), "minutes");
|
||||
let downtimeDuration = Math.round(moment(alert.updated_at).diff(moment(alert.created_at), "seconds") / 60);
|
||||
comment = comment + `, Total downtime: ` + downtimeDuration + ` minutes`;
|
||||
return comment;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user