(location: string, threshold: number = 1500, task?: ServerTask, output?: string)
| 1482 | } |
| 1483 | |
| 1484 | #detectAutoYield(location: string, threshold: number = 1500, task?: ServerTask, output?: string) { |
| 1485 | const timeRemaining = this.#getRemainingTimeInMillis(); |
| 1486 | |
| 1487 | if (timeRemaining && timeRemaining < threshold) { |
| 1488 | if (task) { |
| 1489 | throw new AutoYieldWithCompletedTaskExecutionError( |
| 1490 | task.id, |
| 1491 | task.outputProperties ?? [], |
| 1492 | { |
| 1493 | location, |
| 1494 | timeRemaining, |
| 1495 | timeElapsed: this.#getTimeElapsed(), |
| 1496 | }, |
| 1497 | output |
| 1498 | ); |
| 1499 | } else { |
| 1500 | throw new AutoYieldExecutionError(location, timeRemaining, this.#getTimeElapsed()); |
| 1501 | } |
| 1502 | } |
| 1503 | } |
| 1504 | |
| 1505 | #forceYield(location: string, task?: ServerTask, output?: string) { |
| 1506 | const timeRemaining = this.#getRemainingTimeInMillis(); |
no test coverage detected