From e07c3abcbc3998f92e327c0100d99d16ba8873d9 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 16 Oct 2020 17:16:52 +0100 Subject: [PATCH] all working, scheduled texts --- index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 0d87351..dca2f64 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,8 @@ const request = require('request'); require('dotenv').config(); +console.log('QHM Shipping movements Service Starting Up...'); + async function main() { const today = new Date(); @@ -71,11 +73,9 @@ async function main() } } -main(); - -function TestDay() -{ - // if -} - -setInterval(TestDay, process.env.CHECK_INTERVAL); +setInterval(function(){ + let date = new Date(); + if (date.getHours() === 12 && date.getMinutes() === 00) { + main(); + } +}, 60000);