mirror of
https://github.com/status-im/codimd.git
synced 2025-01-13 23:24:34 +00:00
f1680ef7fa
Signed-off-by: Max Wu <jackymaxj@gmail.com>
17 lines
309 B
JavaScript
17 lines
309 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()
|
|
}
|
|
}
|