diff options
author | Joel Kronqvist <work.joelkronqvist@gmail.com> | 2022-11-03 17:45:27 +0200 |
---|---|---|
committer | Joel Kronqvist <work.joelkronqvist@gmail.com> | 2022-11-03 17:45:27 +0200 |
commit | 4a9dca9ffccb087135c6e2d0eebae45cd567036d (patch) | |
tree | 4b4510fd8d25d657fb1927660ebbeec936281d67 /Functions | |
parent | 5f74d40fa736745651514853afdca3ed44e5ae74 (diff) | |
download | LYLLRuoka-4a9dca9ffccb087135c6e2d0eebae45cd567036d.tar.gz LYLLRuoka-4a9dca9ffccb087135c6e2d0eebae45cd567036d.zip |
Corrected typo, added 1h30min waiting time before the foods are updated
You never know if the city's servers don't get updated instantly, so it might not be a good idea to ask for the foods at (at worst) 1 ms after 00:00 at monday.
Diffstat (limited to 'Functions')
-rw-r--r-- | Functions/dateFuncs.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Functions/dateFuncs.js b/Functions/dateFuncs.js index 55a9372..340b46e 100644 --- a/Functions/dateFuncs.js +++ b/Functions/dateFuncs.js @@ -46,9 +46,10 @@ function run_at_monday_mornings(func) { days_to_elapse = 8 - weekday; ms_to_elapse = ms_in_h * ( days_to_elapse * 24/*hours in a day*/ - - hour // removes unneccessary hours so that we update it at 0 am - ) + 1 /*+1 so that we know that it won't be exactly midnight - and possibly sunday. idk if this actually is needed.*/; + - hour + 1.5 // removes unneccessary hours so that we update it at 1:30 am + // 1:30 just in case the foods aren't updated instantly to the city's + // servers. + ); setTimeout(() => run_at_monday_mornings(func), ms_to_elapse); |