remove dead code
This commit is contained in:
@@ -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]);
|
||||
},
|
||||
|
||||
@@ -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]);
|
||||
},
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -146,10 +146,6 @@ export class ManagedRuntimeManager implements RuntimeManager {
|
||||
});
|
||||
}
|
||||
|
||||
associateWaitWithWaitpoint(waitId: string, waitpointId: string) {
|
||||
this.resolversByWaitpoint.set(waitpointId, waitId);
|
||||
}
|
||||
|
||||
async completeWaitpoints(waitpoints: CompletedWaitpoint[]): Promise<void> {
|
||||
await Promise.all(waitpoints.map((waitpoint) => this.completeWaitpoint(waitpoint)));
|
||||
}
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user