summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
authorSheogorath2018-11-27 00:26:25 +0100
committerSheogorath2019-05-25 21:08:38 +0200
commit6c62efae2ad2dac6f4c58bd84726cfb36ea9a84b (patch)
tree536e541ee0bde9ebc2d356afb8728bf8df76f980 /lib/web
parent816ed4ebc7e0265b353f80285fe9601b2231dd90 (diff)
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>
Diffstat (limited to 'lib/web')
-rw-r--r--lib/web/middleware/tooBusy.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/web/middleware/tooBusy.js b/lib/web/middleware/tooBusy.js
index f1b72330..128a5679 100644
--- a/lib/web/middleware/tooBusy.js
+++ b/lib/web/middleware/tooBusy.js
@@ -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()) {