Skip to content

Commit 9f6696d

Browse files
committed
fix merged task retry config indexing
1 parent 9350770 commit 9f6696d

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

packages/cli-v3/src/entryPoints/deploy-index-worker.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
type HandleErrorFunction,
44
indexerToWorkerMessages,
55
taskCatalog,
6+
type TaskManifest,
67
TriggerConfig,
78
} from "@trigger.dev/core/v3";
89
import {
@@ -105,8 +106,8 @@ if (config.retries?.default) {
105106
if (!task.retry) {
106107
return {
107108
...task,
108-
retries: config.retries?.default,
109-
};
109+
retry: config.retries?.default,
110+
} satisfies TaskManifest;
110111
}
111112

112113
return task;
@@ -122,7 +123,7 @@ if (typeof config.machine === "string") {
122123
machine: {
123124
preset: config.machine,
124125
},
125-
};
126+
} satisfies TaskManifest;
126127
}
127128

128129
return task;
@@ -136,7 +137,7 @@ if (typeof config.maxDuration === "number") {
136137
return {
137138
...task,
138139
maxDuration: config.maxDuration,
139-
};
140+
} satisfies TaskManifest;
140141
}
141142

142143
return task;

packages/cli-v3/src/entryPoints/dev-index-worker.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
type HandleErrorFunction,
44
indexerToWorkerMessages,
55
taskCatalog,
6+
type TaskManifest,
67
TriggerConfig,
78
} from "@trigger.dev/core/v3";
89
import {
@@ -99,14 +100,28 @@ const { buildManifest, importErrors, config } = await bootstrap();
99100

100101
let tasks = taskCatalog.listTaskManifests();
101102

103+
// If the config has retry defaults, we need to apply them to all tasks that don't have any retry settings
104+
if (config.retries?.default) {
105+
tasks = tasks.map((task) => {
106+
if (!task.retry) {
107+
return {
108+
...task,
109+
retry: config.retries?.default,
110+
} satisfies TaskManifest;
111+
}
112+
113+
return task;
114+
});
115+
}
116+
102117
// If the config has a maxDuration, we need to apply it to all tasks that don't have a maxDuration
103118
if (typeof config.maxDuration === "number") {
104119
tasks = tasks.map((task) => {
105120
if (typeof task.maxDuration !== "number") {
106121
return {
107122
...task,
108123
maxDuration: config.maxDuration,
109-
};
124+
} satisfies TaskManifest;
110125
}
111126

112127
return task;

0 commit comments

Comments
 (0)