mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
f78540c3fb
Because of circular import problems, this commit also moves the error messages from response.js to errors.js Signed-off-by: David Mehren <dmehren1@gmail.com>
16 lines
299 B
JavaScript
16 lines
299 B
JavaScript
'use strict'
|
|
|
|
const toobusy = require('toobusy-js')
|
|
|
|
const errors = require('../../errors')
|
|
const config = require('../../config')
|
|
|
|
toobusy.maxLag(config.tooBusyLag)
|
|
|
|
module.exports = function (req, res, next) {
|
|
if (toobusy()) {
|
|
errors.errorServiceUnavailable(res)
|
|
} else {
|
|
next()
|
|
}
|
|
}
|