Updated scheduler to check bans once a day.
This commit is contained in:
parent
8fc699924e
commit
2b52fe7f2f
|
|
@ -215,7 +215,6 @@ userBanSchema.statics.processExpiredBans = async function(){
|
||||||
banDB.forEach(async (ban) => {
|
banDB.forEach(async (ban) => {
|
||||||
//This ban was already processed, and it's user has been deleted. There is no more to be done...
|
//This ban was already processed, and it's user has been deleted. There is no more to be done...
|
||||||
if(ban.user == null){
|
if(ban.user == null){
|
||||||
console.log(ban);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,5 @@ const userBanSchema = require('../schemas/userBanSchema');
|
||||||
|
|
||||||
module.exports.kickoff = function(){
|
module.exports.kickoff = function(){
|
||||||
//Process expired bans every night at midnight
|
//Process expired bans every night at midnight
|
||||||
cron.schedule('* * * * *', ()=>{userBanSchema.processExpiredBans()},{scheduled: true, timezone: "UTC"});
|
cron.schedule('0 0 * * *', ()=>{userBanSchema.processExpiredBans()},{scheduled: true, timezone: "UTC"});
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue