diff --git a/utils/keepServer.js b/utils/keepServer.js deleted file mode 100644 index 040dbce..0000000 --- a/utils/keepServer.js +++ /dev/null @@ -1,17 +0,0 @@ -const logger = require('./logger'); -const axios = require('axios'); -const HEALTH_CHECK_URL = process.env.HEALTH_CHECK_URL - - -const keepServer = async () => { - try { - const health = await axios.get(`${HEALTH_CHECK_URL}`) - logger.info(health.data) - } catch (error) { - logger.error('Server is down') - } -} - -setTimeout(() =>{ - keepServer() -}, 1000 * 60 * 45) \ No newline at end of file diff --git a/utils/monitorServer.js b/utils/monitorServer.js new file mode 100644 index 0000000..87f580c --- /dev/null +++ b/utils/monitorServer.js @@ -0,0 +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