Implement stats middleware removing some duplicated code
This commit is contained in:
@@ -35,8 +35,6 @@ module.exports = function errorMiddleware (/* options */) {
|
||||
res.set('X-Served-By-DB-Host', res.locals.dbhost);
|
||||
}
|
||||
|
||||
res.set('X-Tiler-Profiler', req.profiler.toJSONString());
|
||||
|
||||
res.status(statusCode);
|
||||
|
||||
if (req.query && req.query.callback) {
|
||||
@@ -44,14 +42,6 @@ module.exports = function errorMiddleware (/* options */) {
|
||||
} else {
|
||||
res.json(errorResponseBody);
|
||||
}
|
||||
|
||||
try {
|
||||
// May throw due to dns, see
|
||||
// See http://github.com/CartoDB/Windshaft/issues/166
|
||||
req.profiler.sendStats();
|
||||
} catch (err) {
|
||||
debug("error sending profiling stats: " + err);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user