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 = {
5656 // socket.io
5757 heartbeatInterval : 5000 ,
5858 heartbeatTimeout : 10000 ,
59+ // toobusy-js
60+ responseMaxLag : 70 ,
5961 // document
6062 documentMaxLength : 100000 ,
6163 // 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 = {
3333 dbURL : process . env . CMD_DB_URL ,
3434 sessionSecret : process . env . CMD_SESSION_SECRET ,
3535 sessionLife : toIntegerConfig ( process . env . CMD_SESSION_LIFE ) ,
36+ responseMaxLag : toIntegerConfig ( process . env . CMD_RESPONSE_MAX_LAG ) ,
3637 imageUploadType : process . env . CMD_IMAGE_UPLOAD_TYPE ,
3738 imgur : {
3839 clientID : process . env . CMD_IMGUR_CLIENTID
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ module.exports = {
2828 dbURL : process . env . HMD_DB_URL ,
2929 sessionSecret : process . env . HMD_SESSION_SECRET ,
3030 sessionLife : toIntegerConfig ( process . env . HMD_SESSION_LIFE ) ,
31+ responseMaxLag : toIntegerConfig ( process . env . HMD_RESPONSE_MAX_LAG ) ,
3132 imageUploadType : process . env . HMD_IMAGE_UPLOAD_TYPE ,
3233 imgur : {
3334 clientID : process . env . HMD_IMGUR_CLIENTID
Original file line number Diff line number Diff line change 22
33const toobusy = require ( 'toobusy-js' )
44
5+ const config = require ( '../../config' )
56const response = require ( '../../response' )
67
8+ toobusy . maxLag ( config . responseMaxLag ) ;
9+
710module . exports = function ( req , res , next ) {
811 if ( toobusy ( ) ) {
912 response . errorServiceUnavailable ( res )
You can’t perform that action at this time.
0 commit comments