Skip to content

Commit 09a13bd

Browse files
authored
Merge pull request #164 from n0th1ng-else/uptime
2 parents cf27dc5 + 21abe5e commit 09a13bd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/helpers/date.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const dateDifference = (start?: Date): string => {
5050
const newPart = Math.floor(acc.ms / frame);
5151
const newMs = acc.ms - newPart * frame;
5252
return {
53-
ms: acc.ms - newMs,
53+
ms: newMs,
5454
parts: [...acc.parts, newPart]
5555
};
5656
},

src/helpers/uptime.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export const initUptime = (host: string): void => {
2323

2424
logger.warn('Initializing the status handler');
2525
startDate = new Date();
26-
const statusUrl = `https://${host}/status`;
26+
const protocol = host.includes('localhost') ? 'http' : 'https';
27+
const statusUrl = `${protocol}://${host}/status`;
2728
checkStatus(statusUrl);
2829
timerHandler = setInterval(() => {
2930
logger.warn('Check the health status', statusUrl);

0 commit comments

Comments
 (0)