mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 14:49:07 +00:00
refactor: Update logger.error statements for exiting node process
This commit is contained in:
parent
a5f05376b0
commit
f592e852f2
@ -30,7 +30,7 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
@ -31,7 +31,7 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
@ -78,6 +78,6 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -146,7 +146,7 @@ const init: InitFunction = async (
|
||||
): Promise<ExpressApplication> => {
|
||||
const { appName, port, isFrontendApp = false } = data;
|
||||
|
||||
logger.debug(`App Version: ${AppVersion.toString()}`);
|
||||
logger.info(`App Version: ${AppVersion.toString()}`);
|
||||
|
||||
await Express.launchApplication(appName, port);
|
||||
LocalCache.setString('app', 'name', appName);
|
||||
|
@ -31,7 +31,7 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
@ -74,6 +74,6 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -36,6 +36,6 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -48,6 +48,6 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -71,6 +71,6 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
@ -130,14 +130,20 @@ export default class MonitorUtil {
|
||||
failureCause: '',
|
||||
};
|
||||
|
||||
if (!monitorStep.data || !monitorStep.data?.monitorDestination) {
|
||||
if (!monitorStep.data) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
monitor.monitorType === MonitorType.Ping ||
|
||||
monitor.monitorType === MonitorType.IP
|
||||
) {
|
||||
|
||||
if (!monitorStep.data?.monitorDestination) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (LocalCache.getString('PROBE', 'PING_MONITORING') === 'PORT') {
|
||||
// probe is online but ping monitoring is blocked by the cloud provider. Fallback to port monitoring.
|
||||
|
||||
@ -178,6 +184,11 @@ export default class MonitorUtil {
|
||||
}
|
||||
|
||||
if (monitor.monitorType === MonitorType.Port) {
|
||||
|
||||
if (!monitorStep.data?.monitorDestination) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!monitorStep.data?.monitorDestinationPort) {
|
||||
result.isOnline = false;
|
||||
result.responseTimeInMs = 0;
|
||||
@ -249,6 +260,11 @@ export default class MonitorUtil {
|
||||
}
|
||||
|
||||
if (monitor.monitorType === MonitorType.SSLCertificate) {
|
||||
|
||||
if (!monitorStep.data?.monitorDestination) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!monitorStep.data?.monitorDestination) {
|
||||
result.isOnline = false;
|
||||
result.responseTimeInMs = 0;
|
||||
@ -277,6 +293,11 @@ export default class MonitorUtil {
|
||||
}
|
||||
|
||||
if (monitor.monitorType === MonitorType.Website) {
|
||||
|
||||
if (!monitorStep.data?.monitorDestination) {
|
||||
return result;
|
||||
}
|
||||
|
||||
const response: ProbeWebsiteResponse | null =
|
||||
await WebsiteMonitor.ping(
|
||||
monitorStep.data?.monitorDestination as URL,
|
||||
@ -300,6 +321,11 @@ export default class MonitorUtil {
|
||||
}
|
||||
|
||||
if (monitor.monitorType === MonitorType.API) {
|
||||
|
||||
if (!monitorStep.data?.monitorDestination) {
|
||||
return result;
|
||||
}
|
||||
|
||||
let requestBody: JSONObject | undefined = undefined;
|
||||
if (
|
||||
monitorStep.data?.requestBody &&
|
||||
|
@ -29,7 +29,7 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
|
@ -37,6 +37,6 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
|
||||
init().catch((err: Error) => {
|
||||
logger.error(err);
|
||||
logger.debug('Exiting node process');
|
||||
logger.error('Exiting node process');
|
||||
process.exit(1);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user