mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
opening transactions only on write operations which enforces exclusive lock only there to improve concurrency, custom handling of sync request timeouts, #1093, #1018
This commit is contained in:
@@ -316,11 +316,11 @@ function dynamicRequire(moduleName) {
|
||||
}
|
||||
}
|
||||
|
||||
function timeLimit(cb, limitMs) {
|
||||
function timeLimit(promise, limitMs) {
|
||||
return new Promise((res, rej) => {
|
||||
let resolved = false;
|
||||
|
||||
cb().then(() => {
|
||||
promise.then(() => {
|
||||
resolved = true;
|
||||
|
||||
res();
|
||||
@@ -328,7 +328,7 @@ function timeLimit(cb, limitMs) {
|
||||
|
||||
setTimeout(() => {
|
||||
if (!resolved) {
|
||||
rej('Process exceeded time limit ' + limitMs);
|
||||
rej(new Error('Process exceeded time limit ' + limitMs));
|
||||
}
|
||||
}, limitMs);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user