allow some latency

This commit is contained in:
jomo 2015-05-24 17:22:47 +02:00
parent b7929d06d3
commit add4d1abac

View File

@ -67,11 +67,13 @@ function requestHandler(req, res) {
var local_path = req.url.path_list[0];
logging.log(req.id, req.method, req.url.href);
toobusy.maxLag(200);
if (toobusy()) {
res.writeHead(503, {
"Content-Type": "text/plain"
});
res.end("Server is over capaacity :/");
logging.log(req.id, 503, Date.now() - req.start + "ms", "(error)");
return;
}