mirror of https://github.com/status-im/codimd.git
17 lines
303 B
JavaScript
17 lines
303 B
JavaScript
'use strict'
|
|
|
|
const toobusy = require('toobusy-js')
|
|
|
|
const config = require('../config')
|
|
const response = require('../response')
|
|
|
|
toobusy.maxLag(config.responseMaxLag)
|
|
|
|
module.exports = function (req, res, next) {
|
|
if (toobusy()) {
|
|
response.errorServiceUnavailable(res)
|
|
} else {
|
|
next()
|
|
}
|
|
}
|