File tree Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ module.exports = {
56
56
// socket.io
57
57
heartbeatInterval : 5000 ,
58
58
heartbeatTimeout : 10000 ,
59
+ // toobusy-js
60
+ responseMaxLag : 70 ,
59
61
// document
60
62
documentMaxLength : 100000 ,
61
63
// image upload setting, available options are imgur/s3/filesystem/azure
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ module.exports = {
33
33
dbURL : process . env . CMD_DB_URL ,
34
34
sessionSecret : process . env . CMD_SESSION_SECRET ,
35
35
sessionLife : toIntegerConfig ( process . env . CMD_SESSION_LIFE ) ,
36
+ responseMaxLag : toIntegerConfig ( process . env . CMD_RESPONSE_MAX_LAG ) ,
36
37
imageUploadType : process . env . CMD_IMAGE_UPLOAD_TYPE ,
37
38
imgur : {
38
39
clientID : process . env . CMD_IMGUR_CLIENTID
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module.exports = {
28
28
dbURL : process . env . HMD_DB_URL ,
29
29
sessionSecret : process . env . HMD_SESSION_SECRET ,
30
30
sessionLife : toIntegerConfig ( process . env . HMD_SESSION_LIFE ) ,
31
+ responseMaxLag : toIntegerConfig ( process . env . HMD_RESPONSE_MAX_LAG ) ,
31
32
imageUploadType : process . env . HMD_IMAGE_UPLOAD_TYPE ,
32
33
imgur : {
33
34
clientID : process . env . HMD_IMGUR_CLIENTID
Original file line number Diff line number Diff line change 2
2
3
3
const toobusy = require ( 'toobusy-js' )
4
4
5
+ const config = require ( '../../config' )
5
6
const response = require ( '../../response' )
6
7
8
+ toobusy . maxLag ( config . responseMaxLag ) ;
9
+
7
10
module . exports = function ( req , res , next ) {
8
11
if ( toobusy ( ) ) {
9
12
response . errorServiceUnavailable ( res )
You can’t perform that action at this time.
0 commit comments