summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/config/default.js2
-rw-r--r--lib/config/environment.js1
-rw-r--r--lib/web/middleware/tooBusy.js4
3 files changed, 7 insertions, 0 deletions
diff --git a/lib/config/default.js b/lib/config/default.js
index c87beda3..12254d47 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -56,6 +56,8 @@ module.exports = {
// socket.io
heartbeatInterval: 5000,
heartbeatTimeout: 10000,
+ // too busy timeout
+ tooBusyLag: 70,
// document
documentMaxLength: 100000,
// image upload setting, available options are imgur/s3/filesystem/azure/lutim
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 508c1ba6..0a709745 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -33,6 +33,7 @@ module.exports = {
dbURL: process.env.CMD_DB_URL,
sessionSecret: process.env.CMD_SESSION_SECRET,
sessionLife: toIntegerConfig(process.env.CMD_SESSION_LIFE),
+ tooBusyLag: toIntegerConfig(process.env.CMD_TOOBUSY_LAG),
imageUploadType: process.env.CMD_IMAGE_UPLOAD_TYPE,
imgur: {
clientID: process.env.CMD_IMGUR_CLIENTID
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()) {