Skip to content

Commit 3b932b8

Browse files
authored
Merge pull request #165 from n0th1ng-else/uptime
2 parents 09a13bd + 86e2afa commit 3b932b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers/uptime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ const checkStatus = (url: string): Promise<void> =>
1616
err => logger.error('Unable to access the health status api!', err)
1717
);
1818

19-
export const initUptime = (host: string): void => {
19+
export const initUptime = (host?: string): void => {
2020
if (timerHandler) {
2121
return;
2222
}
2323

2424
logger.warn('Initializing the status handler');
2525
startDate = new Date();
26-
const protocol = host.includes('localhost') ? 'http' : 'https';
26+
const protocol = host && host.includes('localhost') ? 'http' : 'https';
2727
const statusUrl = `${protocol}://${host}/status`;
2828
checkStatus(statusUrl);
2929
timerHandler = setInterval(() => {

0 commit comments

Comments
 (0)