@onlineapps/conn-orch-orchestrator 1.0.52 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -245,7 +245,14 @@ class WorkflowOrchestrator {
|
|
|
245
245
|
|
|
246
246
|
// Get existing retry history from _execution.retry_history
|
|
247
247
|
const stepRetryHistory = currentStepDef._execution?.retry_history || [];
|
|
248
|
-
|
|
248
|
+
|
|
249
|
+
// Count only actual retry attempts (not dlq_entered, requeued, or other records)
|
|
250
|
+
// After requeue, we start fresh with new attempts
|
|
251
|
+
const lastRequeueIndex = stepRetryHistory.findLastIndex(r => r.requeued);
|
|
252
|
+
const attemptsAfterRequeue = lastRequeueIndex >= 0
|
|
253
|
+
? stepRetryHistory.slice(lastRequeueIndex + 1).filter(r => r.attempt).length
|
|
254
|
+
: stepRetryHistory.filter(r => r.attempt).length;
|
|
255
|
+
const attemptNumber = attemptsAfterRequeue + 1;
|
|
249
256
|
|
|
250
257
|
// Generate error reference for log lookup (instead of full stack trace)
|
|
251
258
|
const errorRef = `err-${Date.now()}-${crypto.randomBytes(4).toString('hex')}`;
|
|
@@ -372,7 +379,7 @@ class WorkflowOrchestrator {
|
|
|
372
379
|
const finalCookbook = {
|
|
373
380
|
...cookbookDef,
|
|
374
381
|
steps: updatedSteps,
|
|
375
|
-
_pointer: { next:
|
|
382
|
+
_pointer: { next: current_step } // Points to failed step - resume from here after requeue
|
|
376
383
|
};
|
|
377
384
|
|
|
378
385
|
try {
|