From 54fb9b0b1c1d182724106b574fafea815997d36b Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 23 Dec 2023 12:41:22 +0100 Subject: [PATCH] enable uptime --- config.json | 4 ++-- functions/HEARTBEAT/uptime.js | 3 ++- functions/SETUP/heartbeat.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index 553d909..03ec60c 100644 --- a/config.json +++ b/config.json @@ -27,8 +27,8 @@ }, "heartbeat": { "uptime": { - "interval": 50000, - "endpoint": "http://statuspage_app_sp_1:3001/api/push/" + "interval": 60, + "endpoint": "https://status.flipped.codes/api/push/" } } } diff --git a/functions/HEARTBEAT/uptime.js b/functions/HEARTBEAT/uptime.js index 9482ae7..221a0e1 100644 --- a/functions/HEARTBEAT/uptime.js +++ b/functions/HEARTBEAT/uptime.js @@ -3,6 +3,7 @@ const axios = require('axios'); const params = (pingRaw) => ( { + status: 'up', msg: 'OK', ping: Math.round(pingRaw), } @@ -15,7 +16,7 @@ function sendHeartbeat() { module.exports.run = async () => { setInterval(() => { sendHeartbeat(); - }, config.functions.heartbeat.uptime.interval); + }, config.functions.heartbeat.uptime.interval * 1000); }; module.exports.data = { diff --git a/functions/SETUP/heartbeat.js b/functions/SETUP/heartbeat.js index 6a7b9d5..b413359 100644 --- a/functions/SETUP/heartbeat.js +++ b/functions/SETUP/heartbeat.js @@ -12,7 +12,7 @@ module.exports.run = async () => { // client.functions.get('HEARTBEAT_BOTLIST_discordbots').run(); // client.functions.get('HEARTBEAT_BOTLIST_motiondevelopment').run(); // uptime page - // client.functions.get('HEARTBEAT_uptime').run(); + client.functions.get('HEARTBEAT_uptime').run(); }; module.exports.data = {