(parentById: Map<string, string>, workspaceId: string)
| 6957 | } |
| 6958 | |
| 6959 | private getTaskDepthFromParentById(parentById: Map<string, string>, workspaceId: string): number { |
| 6960 | let depth = 0; |
| 6961 | let current = workspaceId; |
| 6962 | for (let i = 0; i < 32; i++) { |
| 6963 | const parent = parentById.get(current); |
| 6964 | if (!parent) break; |
| 6965 | depth += 1; |
| 6966 | current = parent; |
| 6967 | } |
| 6968 | |
| 6969 | if (depth >= 32) { |
| 6970 | throw new Error( |
| 6971 | `getTaskDepthFromParentById: possible parentWorkspaceId cycle starting at ${workspaceId}` |
| 6972 | ); |
| 6973 | } |
| 6974 | |
| 6975 | return depth; |
| 6976 | } |
| 6977 | |
| 6978 | async maybeStartQueuedTasks(): Promise<void> { |
| 6979 | const existingRun = this.maybeStartQueuedTasksInFlight; |
no test coverage detected