From b384dad994a6bb121ed579cd7bf5764254168063 Mon Sep 17 00:00:00 2001 From: nicktrn <55853254+nicktrn@users.noreply.github.com> Date: Tue, 29 Apr 2025 08:53:09 +0100 Subject: [PATCH] remove dead code --- .../cli-v3/src/entryPoints/dev-run-worker.ts | 9 ---- .../src/entryPoints/managed-run-worker.ts | 9 ---- .../cli-v3/src/executions/taskRunProcess.ts | 50 ------------------- .../src/v3/runtime/managedRuntimeManager.ts | 4 -- packages/core/src/v3/schemas/messages.ts | 29 ----------- 5 files changed, 101 deletions(-) diff --git a/packages/cli-v3/src/entryPoints/dev-run-worker.ts b/packages/cli-v3/src/entryPoints/dev-run-worker.ts index fed66e6dc..3d20547be 100644 --- a/packages/cli-v3/src/entryPoints/dev-run-worker.ts +++ b/packages/cli-v3/src/entryPoints/dev-run-worker.ts @@ -452,18 +452,9 @@ const zodIpc = new ZodIpcConnection({ }); } }, - TASK_RUN_COMPLETED_NOTIFICATION: async () => { - await managedWorkerRuntime.completeWaitpoints([]); - }, - WAIT_COMPLETED_NOTIFICATION: async () => { - await managedWorkerRuntime.completeWaitpoints([]); - }, FLUSH: async ({ timeoutInMs }, sender) => { await flushAll(timeoutInMs); }, - WAITPOINT_CREATED: async ({ wait, waitpoint }) => { - managedWorkerRuntime.associateWaitWithWaitpoint(wait.id, waitpoint.id); - }, WAITPOINT_COMPLETED: async ({ waitpoint }) => { managedWorkerRuntime.completeWaitpoints([waitpoint]); }, diff --git a/packages/cli-v3/src/entryPoints/managed-run-worker.ts b/packages/cli-v3/src/entryPoints/managed-run-worker.ts index 19c8718cc..298695dd5 100644 --- a/packages/cli-v3/src/entryPoints/managed-run-worker.ts +++ b/packages/cli-v3/src/entryPoints/managed-run-worker.ts @@ -445,18 +445,9 @@ const zodIpc = new ZodIpcConnection({ }); } }, - TASK_RUN_COMPLETED_NOTIFICATION: async () => { - await managedWorkerRuntime.completeWaitpoints([]); - }, - WAIT_COMPLETED_NOTIFICATION: async () => { - await managedWorkerRuntime.completeWaitpoints([]); - }, FLUSH: async ({ timeoutInMs }, sender) => { await flushAll(timeoutInMs); }, - WAITPOINT_CREATED: async ({ wait, waitpoint }) => { - managedWorkerRuntime.associateWaitWithWaitpoint(wait.id, waitpoint.id); - }, WAITPOINT_COMPLETED: async ({ waitpoint }) => { managedWorkerRuntime.completeWaitpoints([waitpoint]); }, diff --git a/packages/cli-v3/src/executions/taskRunProcess.ts b/packages/cli-v3/src/executions/taskRunProcess.ts index ae95ecb10..c82a18598 100644 --- a/packages/cli-v3/src/executions/taskRunProcess.ts +++ b/packages/cli-v3/src/executions/taskRunProcess.ts @@ -278,56 +278,6 @@ export class TaskRunProcess { return result; } - taskRunCompletedNotification(completion: TaskRunExecutionResult) { - if (!completion.ok && typeof completion.retry !== "undefined") { - logger.debug( - "Task run completed with error and wants to retry, won't send task run completed notification" - ); - return; - } - - if (!this._child?.connected || this._isBeingKilled || this._child.killed) { - logger.debug( - "Child process not connected or being killed, can't send task run completed notification" - ); - return; - } - - this._ipc?.send("TASK_RUN_COMPLETED_NOTIFICATION", { - version: "v2", - completion, - }); - } - - waitCompletedNotification() { - if (!this._child?.connected || this._isBeingKilled || this._child.killed) { - console.error( - "Child process not connected or being killed, can't send wait completed notification" - ); - return; - } - - this._ipc?.send("WAIT_COMPLETED_NOTIFICATION", {}); - } - - waitpointCreated(waitId: string, waitpointId: string) { - if (!this._child?.connected || this._isBeingKilled || this._child.killed) { - console.error( - "Child process not connected or being killed, can't send waitpoint created notification" - ); - return; - } - - this._ipc?.send("WAITPOINT_CREATED", { - wait: { - id: waitId, - }, - waitpoint: { - id: waitpointId, - }, - }); - } - waitpointCompleted(waitpoint: CompletedWaitpoint) { if (!this._child?.connected || this._isBeingKilled || this._child.killed) { console.error( diff --git a/packages/core/src/v3/runtime/managedRuntimeManager.ts b/packages/core/src/v3/runtime/managedRuntimeManager.ts index d23f800d7..eccd97cf1 100644 --- a/packages/core/src/v3/runtime/managedRuntimeManager.ts +++ b/packages/core/src/v3/runtime/managedRuntimeManager.ts @@ -146,10 +146,6 @@ export class ManagedRuntimeManager implements RuntimeManager { }); } - associateWaitWithWaitpoint(waitId: string, waitpointId: string) { - this.resolversByWaitpoint.set(waitpointId, waitId); - } - async completeWaitpoints(waitpoints: CompletedWaitpoint[]): Promise { await Promise.all(waitpoints.map((waitpoint) => this.completeWaitpoint(waitpoint))); } diff --git a/packages/core/src/v3/schemas/messages.ts b/packages/core/src/v3/schemas/messages.ts index edbdfac3d..cffcb7c15 100644 --- a/packages/core/src/v3/schemas/messages.ts +++ b/packages/core/src/v3/schemas/messages.ts @@ -219,41 +219,12 @@ export const WorkerToExecutorMessageCatalog = { isWarmStart: z.boolean().optional(), }), }, - TASK_RUN_COMPLETED_NOTIFICATION: { - message: z.discriminatedUnion("version", [ - z.object({ - version: z.literal("v1"), - completion: TaskRunExecutionResult, - execution: TaskRunExecution, - }), - z.object({ - version: z.literal("v2"), - completion: TaskRunExecutionResult, - }), - ]), - }, - WAIT_COMPLETED_NOTIFICATION: { - message: z.object({ - version: z.literal("v1").default("v1"), - }), - }, FLUSH: { message: z.object({ timeoutInMs: z.number(), }), callback: z.void(), }, - WAITPOINT_CREATED: { - message: z.object({ - version: z.literal("v1").default("v1"), - wait: z.object({ - id: z.string(), - }), - waitpoint: z.object({ - id: z.string(), - }), - }), - }, WAITPOINT_COMPLETED: { message: z.object({ version: z.literal("v1").default("v1"),