Skip to content

Commit

Permalink
🐛 Minimum uptime has to be +0
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 22, 2020
1 parent d1fa0a6 commit fd02605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/calculate-uptime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ export const getUptimePercentForSite = async (slug: string): Promise<string> =>
const downtimeSeconds = await getDowntimeSecondsForSite(slug);

// Return a percentage string
return `${(100 - (downtimeSeconds / totalSeconds) * 100).toFixed(2)}%`;
return `${Math.min(0, 100 - (downtimeSeconds / totalSeconds) * 100).toFixed(2)}%`;
};

0 comments on commit fd02605

Please sign in to comment.