1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 12:21:00 -05:00

Update time for resetAllData()

This commit is contained in:
Toast 2023-10-07 10:57:14 +11:00 committed by GitHub
parent 2767eca018
commit c31bda2fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,8 +21,8 @@ export default class userLevels extends Schema {
this._content = Schema; this._content = Schema;
} }
async resetAllData(){ async resetAllData(){
// Every 1st of January at 00:00 // Every 1st of January at 11:00 (Midnight in London, 11AM in Sydney)
cron.schedule('0 0 1 1 *', async()=>{ cron.schedule('0 11 1 1 *', async()=>{
Logger.forwardToConsole('log', 'Cron', 'Running job "resetAllData", this is activated every 1st of January'); Logger.forwardToConsole('log', 'Cron', 'Running job "resetAllData", this is activated every 1st of January');
const countDataBeforeReset = await this._content.countDocuments(); const countDataBeforeReset = await this._content.countDocuments();
Logger.forwardToConsole('log', 'Cron:resetAllData', `Counted ${countDataBeforeReset.toLocaleString()} documents before reset`); Logger.forwardToConsole('log', 'Cron:resetAllData', `Counted ${countDataBeforeReset.toLocaleString()} documents before reset`);