Finished up implementing channel-based user bans.
This commit is contained in:
parent
ef79e9941c
commit
96953979a2
19 changed files with 518 additions and 202 deletions
|
|
@ -18,9 +18,20 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
const cron = require('node-cron');
|
||||
|
||||
//Local Imports
|
||||
const userBanSchema = require('../schemas/userBanSchema');
|
||||
const userBanModel = require('../schemas/userBanSchema');
|
||||
const channelModel = require('../schemas/channel/channelSchema');
|
||||
|
||||
module.exports.schedule = function(){
|
||||
//Process expired global bans every night at midnight
|
||||
cron.schedule('0 0 * * *', ()=>{userBanModel.processExpiredBans()},{scheduled: true, timezone: "UTC"});
|
||||
}
|
||||
|
||||
module.exports.kickoff = function(){
|
||||
//Process expired bans every night at midnight
|
||||
cron.schedule('0 0 * * *', ()=>{userBanSchema.processExpiredBans()},{scheduled: true, timezone: "UTC"});
|
||||
//Process expired global bans that may have expired since last restart
|
||||
userBanModel.processExpiredBans()
|
||||
//Process expired channel bans that may haven ot expired since last restart
|
||||
channelModel.processExpiredBans();
|
||||
|
||||
//Schedule jobs
|
||||
module.exports.schedule();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue