|
1 | 1 | import { |
| 2 | + attemptKey, |
2 | 3 | CompletedWaitpoint, |
3 | 4 | ExecutorToWorkerMessageCatalog, |
4 | 5 | MachinePresetResources, |
@@ -164,15 +165,17 @@ export class TaskRunProcess { |
164 | 165 | TASK_RUN_COMPLETED: async (message) => { |
165 | 166 | const { result, execution } = message; |
166 | 167 |
|
167 | | - const promiseStatus = this._attemptStatuses.get(execution.attempt.id); |
| 168 | + const key = attemptKey(execution); |
| 169 | + |
| 170 | + const promiseStatus = this._attemptStatuses.get(key); |
168 | 171 |
|
169 | 172 | if (promiseStatus !== "PENDING") { |
170 | 173 | return; |
171 | 174 | } |
172 | 175 |
|
173 | | - this._attemptStatuses.set(execution.attempt.id, "RESOLVED"); |
| 176 | + this._attemptStatuses.set(key, "RESOLVED"); |
174 | 177 |
|
175 | | - const attemptPromise = this._attemptPromises.get(execution.attempt.id); |
| 178 | + const attemptPromise = this._attemptPromises.get(key); |
176 | 179 |
|
177 | 180 | if (!attemptPromise) { |
178 | 181 | return; |
@@ -229,10 +232,12 @@ export class TaskRunProcess { |
229 | 232 | rejecter = reject; |
230 | 233 | }); |
231 | 234 |
|
232 | | - this._attemptStatuses.set(params.payload.execution.attempt.id, "PENDING"); |
| 235 | + const key = attemptKey(params.payload.execution); |
| 236 | + |
| 237 | + this._attemptStatuses.set(key, "PENDING"); |
233 | 238 |
|
234 | 239 | // @ts-expect-error - We know that the resolver and rejecter are defined |
235 | | - this._attemptPromises.set(params.payload.execution.attempt.id, { resolver, rejecter }); |
| 240 | + this._attemptPromises.set(key, { resolver, rejecter }); |
236 | 241 |
|
237 | 242 | const { execution, traceContext, metrics } = params.payload; |
238 | 243 |
|
|
0 commit comments