performance monitoring on frontend in dev environment

This commit is contained in:
zadam
2020-08-30 22:29:38 +02:00
parent 81207f3d27
commit 5d500de527
2 changed files with 30 additions and 3 deletions

View File

@@ -197,8 +197,20 @@ function executeScript(query) {
function wrap(query, func) {
const startTimestamp = Date.now();
let result;
const result = func(stmt(query));
try {
result = func(stmt(query));
}
catch (e) {
if (e.message.includes("The database connection is not open")) {
// this often happens on killing the app which puts these alerts in front of user
// in these cases error should be simply ignored.
console.log(e.message);
return null
}
}
const milliseconds = Date.now() - startTimestamp;