Add config for toobusy middleware

With very low CPU frequency or bad IO situation, as well as not-loaded
JS CodiMD happens to present unneeded "I'm busy"-messages to users.

This patch allows to configure the lag. The default is taken from the
libray but set in our own default configs.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
Sheogorath 2018-11-27 00:26:25 +01:00
parent 816ed4ebc7
commit 6c62efae2a
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD
5 changed files with 9 additions and 0 deletions

View file

@ -2,7 +2,11 @@
const toobusy = require('toobusy-js')
const response = require('../../response')
const config = require('../../config')
toobusy.maxLag(config.tooBusyLag)
module.exports = function (req, res, next) {
if (toobusy()) {