Skip to content

Commit

Permalink
Merge pull request #931 from botpress/ya-config-for-test
Browse files Browse the repository at this point in the history
feat(core): new configs to silence logs and disable cluster mode
  • Loading branch information
slvnperron committed Sep 19, 2018
2 parents 3932353 + 7be9a1b commit 61e7293
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/core/botpress/src/botpress.js
Expand Up @@ -472,7 +472,9 @@ class botpress {
}
})

cluster.fork().on('message', receiveMessageFromWorker)
if (!this.botfile.disableClusterMode) {
cluster.fork().on('message', receiveMessageFromWorker)
}
}

if (cluster.isWorker) {
Expand Down
13 changes: 10 additions & 3 deletions packages/core/botpress/src/cli/templates/init-default/botfile.js
Expand Up @@ -62,11 +62,13 @@ module.exports = {
mediaDir: './generated/media',

/*
By default logs are enabled and stored in the DB
By default logs are enabled and stored in the DB.
Silent mode prevents logs from being displayed in the console
*/
logs: {
enabled: true,
keepDays: 30
keepDays: 30,
silentMode: false
},

/*
Expand Down Expand Up @@ -133,5 +135,10 @@ module.exports = {
If this is set to false, you should call `bp.middlewares.load` manually
*/
autoLoading: true
}
},

/*
Prevents Botpress from creating worker threads
*/
disableClusterMode: false
}
1 change: 1 addition & 0 deletions packages/core/botpress/src/logger/index.js
Expand Up @@ -30,6 +30,7 @@ module.exports = logConfig => {
new winston.transports.Console({
prettyPrint: true,
colorize: true,
silent: logConfig.silentMode,
timestamp: () => moment().format('HH:mm:ss')
})
]
Expand Down

0 comments on commit 61e7293

Please sign in to comment.