* Manually start a **new** task when it was created with `startTask: false`. * * This fires `startTask` as a background async operation for the * `task/images` code-path only. It does **not** handle the * `historyItem` resume path (use the constructor with `startTask: true` * for that).
()
| 1862 | * race on globalState). |
| 1863 | */ |
| 1864 | public start(): void { |
| 1865 | if (this._started) { |
| 1866 | return |
| 1867 | } |
| 1868 | this._started = true |
| 1869 | |
| 1870 | const { task, images } = this.metadata |
| 1871 | |
| 1872 | if (task || images) { |
| 1873 | void this.startTask(task ?? undefined, images ?? undefined).catch((error) => { |
| 1874 | console.error("[Task#start] startTask failed:", error) |
| 1875 | }) |
| 1876 | } |
| 1877 | } |
| 1878 | |
| 1879 | private async startTask(task?: string, images?: string[]): Promise<void> { |
| 1880 | try { |
no test coverage detected