Skip to content

Commit

Permalink
enabled uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-flip committed Dec 23, 2023
1 parent b896f63 commit 4ba3a37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"functions": {
"heartbeat": {
"uptime": {
"interval": 50000,
"endpoint": "http://statuspage_app_sp_1:3001/api/push/"
"interval": 60,
"endpoint": "https://status.flipped.codes/api/push/"
}
},
"messageGarbageCollection": {
Expand Down
4 changes: 3 additions & 1 deletion functions/HEARTBEAT/uptime.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// TODO: use vanilla implementation so not an entire package is needed
const axios = require('axios');

const params = (pingRaw) => (
{
status: 'up',
msg: 'OK',
ping: Math.round(pingRaw),
}
Expand All @@ -14,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 = {
Expand Down
3 changes: 1 addition & 2 deletions functions/SETUP/heartbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ module.exports.run = async () => {
// client.functions.get('HEARTBEAT_BOTLIST_discordbots').run();
// client.functions.get('HEARTBEAT_BOTLIST_motiondevelopment').run();
// uptime page
// TODO: curreclty not set up
// client.functions.get('HEARTBEAT_uptime').run();
client.functions.get('HEARTBEAT_uptime').run();
};

module.exports.data = {
Expand Down

0 comments on commit 4ba3a37

Please sign in to comment.