TaskRunPayloadFromRun converts one task run into the shared payload.
(run *taskpkg.Run)
| 2736 | |
| 2737 | // TaskRunPayloadFromRun converts one task run into the shared payload. |
| 2738 | func TaskRunPayloadFromRun(run *taskpkg.Run) contract.TaskRunPayload { |
| 2739 | if run == nil { |
| 2740 | return contract.TaskRunPayload{} |
| 2741 | } |
| 2742 | |
| 2743 | return contract.TaskRunPayload{ |
| 2744 | ID: run.ID, |
| 2745 | TaskID: run.TaskID, |
| 2746 | Status: run.Status, |
| 2747 | Attempt: run.Attempt, |
| 2748 | PreviousRunID: run.PreviousRunID, |
| 2749 | FailureKind: run.FailureKind, |
| 2750 | ClaimedBy: cloneActorIdentity(run.ClaimedBy), |
| 2751 | SessionID: run.SessionID, |
| 2752 | Origin: run.Origin, |
| 2753 | IdempotencyKey: run.IdempotencyKey, |
| 2754 | NetworkChannel: run.NetworkChannel, |
| 2755 | DesignationGroupID: run.DesignationGroupID, |
| 2756 | ClaimTokenHash: run.ClaimTokenHash, |
| 2757 | LeaseUntil: optionalTime(run.LeaseUntil), |
| 2758 | HeartbeatAt: optionalTime(run.HeartbeatAt), |
| 2759 | CoordinationChannelID: run.CoordinationChannelID, |
| 2760 | QueuedAt: run.QueuedAt, |
| 2761 | ClaimedAt: optionalTime(run.ClaimedAt), |
| 2762 | StartedAt: optionalTime(run.StartedAt), |
| 2763 | EndedAt: optionalTime(run.EndedAt), |
| 2764 | Error: run.Error, |
| 2765 | Metadata: redactRawClaimTokenFields(run.Metadata), |
| 2766 | Result: redactRawClaimTokenFields(run.Result), |
| 2767 | } |
| 2768 | } |
| 2769 | |
| 2770 | // RetryTaskRunResponseFromResult converts one retry result into the shared payload. |
| 2771 | func RetryTaskRunResponseFromResult(result *taskpkg.RetryRunResult) contract.RetryTaskRunResponse { |