@@ -421,11 +421,11 @@ func (s *sysDB) insertWorkflowStatus(ctx context.Context, input insertWorkflowSt
421421 }
422422
423423 // Every time we start executing a workflow (and thus attempt to insert its status), we increment `recovery_attempts` by 1.
424- // When this number becomes equal to `maxRetries + 1`, we mark the workflow as `RETRIES_EXCEEDED `.
424+ // When this number becomes equal to `maxRetries + 1`, we mark the workflow as `MAX_RECOVERY_ATTEMPTS_EXCEEDED `.
425425 if result .status != WorkflowStatusSuccess && result .status != WorkflowStatusError &&
426426 input .maxRetries > 0 && result .attempts > input .maxRetries + 1 {
427427
428- // Update workflow status to RETRIES_EXCEEDED and clear queue-related fields
428+ // Update workflow status to MAX_RECOVERY_ATTEMPTS_EXCEEDED and clear queue-related fields
429429 dlqQuery := `UPDATE dbos.workflow_status
430430 SET status = $1, deduplication_id = NULL, started_at_epoch_ms = NULL, queue_name = NULL
431431 WHERE workflow_uuid = $2 AND status = $3`
@@ -436,12 +436,12 @@ func (s *sysDB) insertWorkflowStatus(ctx context.Context, input insertWorkflowSt
436436 WorkflowStatusPending )
437437
438438 if err != nil {
439- return nil , fmt .Errorf ("failed to update workflow to RETRIES_EXCEEDED : %w" , err )
439+ return nil , fmt .Errorf ("failed to update workflow to %s : %w" , WorkflowStatusRetriesExceeded , err )
440440 }
441441
442442 // Commit the transaction before throwing the error
443443 if err := input .tx .Commit (ctx ); err != nil {
444- return nil , fmt .Errorf ("failed to commit transaction after marking workflow as RETRIES_EXCEEDED : %w" , err )
444+ return nil , fmt .Errorf ("failed to commit transaction after marking workflow as %s : %w" , WorkflowStatusRetriesExceeded , err )
445445 }
446446
447447 return nil , newDeadLetterQueueError (input .status .ID , input .maxRetries )
0 commit comments