mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fix DB setup
This commit is contained in:
@@ -80,6 +80,8 @@ function apiRoute(method, path, routeHandler) {
|
||||
|
||||
function route(method, path, middleware, routeHandler, resultHandler, transactional = true) {
|
||||
router[method](path, ...middleware, (req, res, next) => {
|
||||
const start = Date.now();
|
||||
|
||||
try {
|
||||
cls.namespace.bindEmitter(req);
|
||||
cls.namespace.bindEmitter(res);
|
||||
@@ -103,6 +105,12 @@ function route(method, path, middleware, routeHandler, resultHandler, transactio
|
||||
|
||||
res.sendStatus(500);
|
||||
}
|
||||
|
||||
const time = Date.now() - start;
|
||||
|
||||
if (time >= 10) {
|
||||
console.log(`Slow request: ${time}ms - ${method} ${path}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user