Skip to content

Commit 982223c

Browse files
committed
a couple tweaks
1 parent 83b4fdf commit 982223c

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

packages/core/src/v3/workers/taskExecutor.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ export class TaskExecutor {
134134

135135
const output = await this.#callRun(parsedPayload, ctx, initOutput, signal);
136136

137-
await this.#callOnSuccessFunctions(parsedPayload, output, ctx, initOutput, signal);
138-
139137
try {
140138
const stringifiedOutput = await stringifyIO(output);
141139

@@ -155,6 +153,8 @@ export class TaskExecutor {
155153
span.setAttributes(attributes);
156154
}
157155

156+
await this.#callOnSuccessFunctions(parsedPayload, output, ctx, initOutput, signal);
157+
158158
// Call onComplete with success result
159159
await this.#callOnCompleteFunctions(
160160
parsedPayload,
@@ -173,15 +173,6 @@ export class TaskExecutor {
173173
} catch (outputError) {
174174
recordSpanException(span, outputError);
175175

176-
// Call onComplete with error result
177-
await this.#callOnCompleteFunctions(
178-
parsedPayload,
179-
{ ok: false, error: outputError },
180-
ctx,
181-
initOutput,
182-
signal
183-
);
184-
185176
return {
186177
ok: false,
187178
id: execution.run.id,
@@ -243,15 +234,6 @@ export class TaskExecutor {
243234
} catch (handleErrorError) {
244235
recordSpanException(span, handleErrorError);
245236

246-
// Call onComplete with error result
247-
await this.#callOnCompleteFunctions(
248-
parsedPayload,
249-
{ ok: false, error: handleErrorError },
250-
ctx,
251-
initOutput,
252-
signal
253-
);
254-
255237
return {
256238
ok: false,
257239
id: execution.run.id,

0 commit comments

Comments
 (0)