Don't reset task lifecycle hooks between executions
This commit is contained in:
@@ -69,17 +69,6 @@ export class StandardLifecycleHooksManager implements LifecycleHooksManager {
|
||||
private onCancelHookListeners: (() => Promise<void>)[] = [];
|
||||
|
||||
reset(): void {
|
||||
this.taskInitHooks.clear();
|
||||
this.taskStartHooks.clear();
|
||||
this.taskFailureHooks.clear();
|
||||
this.taskSuccessHooks.clear();
|
||||
this.taskCompleteHooks.clear();
|
||||
this.taskResumeHooks.clear();
|
||||
this.taskCatchErrorHooks.clear();
|
||||
this.taskMiddlewareHooks.clear();
|
||||
this.taskCleanupHooks.clear();
|
||||
this.taskWaitHooks.clear();
|
||||
this.taskCancelHooks.clear();
|
||||
this.onCancelHookListeners.length = 0;
|
||||
this.onWaitHookListeners.length = 0;
|
||||
this.onResumeHookListeners.length = 0;
|
||||
|
||||
@@ -10,6 +10,9 @@ export const helloWorldTask = task({
|
||||
maxTimeoutInMs: 1000,
|
||||
factor: 1.5,
|
||||
},
|
||||
onStart: async ({ payload, ctx, init }) => {
|
||||
logger.info("Hello, world from the onStart hook", { payload, init });
|
||||
},
|
||||
run: async (payload: any, { ctx }) => {
|
||||
logger.info("Hello, world from the init", { ctx, payload });
|
||||
logger.info("env vars", {
|
||||
|
||||
Reference in New Issue
Block a user