fix conditional inloop for uptime duration
This commit is contained in:
1 parent
401c3b83fe
commit
b5e8bdbdcd
1 file changed
+1
-1
@@ -56,7 +56,7 @@ const calculateUptimeDuration = (checks) => {
|
||||
const latestCheck = new Date(checks[0].createdAt);
|
||||
let latestDownCheck = 0;
|
||||
|
||||
for (let i = checks.length; i >= 0; i--) {
|
||||
for (let i = checks.length - 1; i >= 0; i--) {
|
||||
if (checks[i].status === false) {
|
||||
latestDownCheck = new Date(checks[i].createdAt);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user