MCPcopy
hub / github.com/coder/mux / getTaskDepthFromParentById

Method getTaskDepthFromParentById

src/node/services/taskService.ts:6959–6976  ·  view source on GitHub ↗
(parentById: Map<string, string>, workspaceId: string)

Source from the content-addressed store, hash-verified

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;

Calls 1

getMethod · 0.65

Tested by

no test coverage detected