mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 20:21:43 +08:00
runOnBackend now does not automatically wait for the maxSyncId since it can easily result in infinite cycle
This commit is contained in:
parent
fbbd51d0b1
commit
cc887a00f2
2 changed files with 10 additions and 3 deletions
|
@ -166,8 +166,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
|||
}, "script");
|
||||
|
||||
if (ret.success) {
|
||||
// wait until all the changes done in the script has been synced to frontend before continuing
|
||||
await ws.waitForEntityChangeId(ret.maxEntityChangeId);
|
||||
// we used to wait for max entity change here returned from the response
|
||||
// but it's too easy to end up in infinite cycle when this is triggered as a consequence of
|
||||
// sync event (typically from custom widget)
|
||||
|
||||
return ret.executionResult;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,13 @@ export default class Component {
|
|||
console.log(`Call to ${fun.name} in ${this.componentId} took ${took}ms`);
|
||||
}
|
||||
|
||||
await utils.timeLimit(promise, 25000, `Time limit failed on ${this.constructor.name} with ${fun.name}`);
|
||||
if (glob.isDev) {
|
||||
await utils.timeLimit(promise, 3000, `Time limit failed on ${this.constructor.name} with ${fun.name}`);
|
||||
}
|
||||
else {
|
||||
// cheaper and in non-dev the extra reporting is lost anyway through reload
|
||||
await promise;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue