v3: fix missing init output in task run function when no middleware is defined

This commit is contained in:
Eric Allam
2024-06-27 11:49:28 +01:00
parent ccb0bc510a
commit 39885a427f
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/core": patch
---
v3: fix missing init output in task run function when no middleware is defined
+1 -1
View File
@@ -229,7 +229,7 @@ export class TaskExecutor {
}
if (!middlewareFn) {
return runFn(payload, { ctx });
return runFn(payload, { ctx, init });
}
return middlewareFn(payload, { ctx, next: async () => runFn(payload, { ctx, init }) });