jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
857 B

'use strict';
process
.on('uncaughtException', console.error)
.on('unhandledRejection', console.error);
const Mongo = require(__dirname+'/../db/db.js')
, config = require(__dirname+'/../lib/misc/config.js')
, { addCallback } = require(__dirname+'/../lib/redis/redis.js');
(async () => {
await Mongo.connect();
await Mongo.checkVersion();
await config.load();
//start all the scheduled tasks
const schedules = require(__dirname+'/tasks/index.js');
//update the schedules to start/stop timer after config change
addCallback('config', () => {
Object.values(schedules).forEach(sc => {
sc.update();
});
});
//update board stats and homepage task, use cron and bull for proper timing
require(__dirname+'/../lib/build/queue.js').push({
'task': 'updateStats',
'options': {}
}, {
'repeat': {
'cron': '0 * * * *'
}
});
})();