feat: modular logging + setup wizard

This commit is contained in:
NGPixel
2017-12-24 00:34:47 -05:00
parent 18dee58a06
commit 2d5a3203db
43 changed files with 997 additions and 557 deletions

View File

@@ -37,11 +37,11 @@ module.exports = {
*/
bootMaster() {
this.preBootMaster().then(sequenceResults => {
if (_.every(sequenceResults, rs => rs === true)) {
if (_.every(sequenceResults, rs => rs === true) && wiki.config.configMode !== 'setup') {
this.postBootMaster()
} else {
wiki.logger.info('Starting configuration manager...')
require('../configure')()
require('../setup')()
}
return true
}).catch(err => {
@@ -52,13 +52,15 @@ module.exports = {
/**
* Post-Master Boot Sequence
*/
postBootMaster() {
require('../master')().then(() => {
_.times(this.numWorker, this.spawnWorker)
async postBootMaster() {
await require('../master')()
wiki.queue.uplClearTemp.add({}, {
repeat: { cron: '*/15 * * * *' }
})
_.times(this.numWorkers, () => {
this.spawnWorker()
})
wiki.queue.uplClearTemp.add({}, {
repeat: { cron: '*/15 * * * *' }
})
cluster.on('exit', (worker, code, signal) => {