mirror of
https://github.com/status-im/codimd.git
synced 2025-01-11 20:44:14 +00:00
da3fd00577
Signed-off-by: BoHong Li <raccoon@hackmd.io>
17 lines
308 B
JavaScript
17 lines
308 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(req, res)
|
|
} else {
|
|
next()
|
|
}
|
|
}
|