mirror of
https://github.com/status-im/codimd.git
synced 2025-01-12 22:54:18 +00:00
231672d455
Signed-off-by: Raccoon <raccoon@hackmd.io>
15 lines
289 B
TypeScript
15 lines
289 B
TypeScript
import * as toobusy from "toobusy-js";
|
|
|
|
import * as config from "../config";
|
|
import * as response from "../response";
|
|
|
|
toobusy.maxLag(config.responseMaxLag)
|
|
|
|
export = function (req, res, next) {
|
|
if (toobusy()) {
|
|
response.errorServiceUnavailable(req, res)
|
|
} else {
|
|
next()
|
|
}
|
|
}
|