feature/IO-3000-messaging-sockets-migration2 -

- Polling Mode indicator now pegged to socket.connected

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-11-27 10:13:38 -08:00
parent 083534c3f3
commit 5e871b024d
3 changed files with 31 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ function StartStatusReporter() {
}
try {
const crispStatusReporter = new CrispStatusReporter({
return new CrispStatusReporter({
token: process.env.CRISP_SECRET_TOKEN, // Your reporter token (given by Crisp)
service_id: process.env.CRISP_SERVICE_IDENTIFIER, // Service ID containing the parent Node for Replica (given by Crisp)
node_id: process.env.CRISP_NODE_IDENTIFIER, // Node ID containing Replica (given by Crisp)
@@ -34,14 +34,28 @@ function StartStatusReporter() {
interval: 30, // Reporting interval (in seconds; defaults to 30 seconds if not set)
console: {
debug: (log_message, data) => logger.log("crisp-status-update", "DEBUG", null, null, { log_message, data }),
log: (log_message, data) => logger.log("crisp-status-update", "DEBUG", null, null, { log_message, data }),
warn: (log_message, data) => logger.log("crisp-status-update", "WARN", null, null, { log_message, data }),
error: (log_message, data) => logger.log("crisp-status-update", "ERROR", null, null, { log_message, data })
debug: (log_message, data) =>
logger.log("crisp-status-update", "DEBUG", null, null, {
log_message,
data
}),
log: (log_message, data) =>
logger.log("crisp-status-update", "DEBUG", null, null, {
log_message,
data
}),
warn: (log_message, data) =>
logger.log("crisp-status-update", "WARN", null, null, {
log_message,
data
}),
error: (log_message, data) =>
logger.log("crisp-status-update", "ERROR", null, null, {
log_message,
data
})
} // Console instance if you need to debug issues,
});
return crispStatusReporter;
} catch (error) {
logger.log("crisp-status-update-error", "DEBUG", null, null, { error: error.message });
}