1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Merge remote-tracking branch 'origin/master' into feature/multistep-form-block

This commit is contained in:
Dean 2024-01-04 11:24:49 +00:00
commit 443ca97152
2 changed files with 5 additions and 2 deletions

View file

@ -50,7 +50,7 @@ export class ExecutionTimeTracker {
return this.totalTimeMs
}
private checkLimit() {
checkLimit() {
if (this.totalTimeMs > this.limitMs) {
throw new ExecutionTimeoutError(
`Execution time limit of ${this.limitMs}ms exceeded: ${this.totalTimeMs}ms`

View file

@ -18,13 +18,16 @@ export function init() {
bbCtx.jsExecutionTracker =
timers.ExecutionTimeTracker.withLimit(perRequestLimit)
}
track = bbCtx.jsExecutionTracker.track.bind(bbCtx.jsExecutionTracker)
span?.addTags({
js: {
limitMS: bbCtx.jsExecutionTracker.limitMs,
elapsedMS: bbCtx.jsExecutionTracker.elapsedMS,
},
})
// We call checkLimit() here to prevent paying the cost of creating
// a new VM context below when we don't need to.
bbCtx.jsExecutionTracker.checkLimit()
track = bbCtx.jsExecutionTracker.track.bind(bbCtx.jsExecutionTracker)
}
}