From ba9bf9cf539f4be629708f0173bd3ecf25e72a46 Mon Sep 17 00:00:00 2001 From: emmanuel-adah Date: Tue, 16 Jun 2026 00:07:15 +0100 Subject: [PATCH] refactor: enable server monitoring --- utils/monitorServer.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/utils/monitorServer.js b/utils/monitorServer.js index 87f580c..0d4a67a 100644 --- a/utils/monitorServer.js +++ b/utils/monitorServer.js @@ -1,17 +1,17 @@ -// const logger = require('./logger'); -// const axios = require('axios'); -// const HEALTH_CHECK_URL = process.env.HEALTH_CHECK_URL -// -// -// const monitorServer = async () => { -// try { -// const health = await axios.get(`${HEALTH_CHECK_URL}`) -// logger.info(health.data) -// } catch (error) { -// logger.error('Server is down: ', error.message) -// } -// } -// -// setInterval(() =>{ -// monitorServer() -// }, 1000 * 60 * 14) \ No newline at end of file +const logger = require('./logger'); +const axios = require('axios'); +const HEALTH_CHECK_URL = process.env.HEALTH_CHECK_URL + + +const monitorServer = async () => { + try { + const health = await axios.get(`${HEALTH_CHECK_URL}`) + logger.info(health.data) + } catch (error) { + logger.error('Server is down: ', error.message) + } +} + +setInterval(() =>{ + monitorServer() +}, 1000 * 60 * 14) \ No newline at end of file