Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connector retry type #216

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions v1/scheduler/attempt_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ type AttemptConfig struct {
// MethodSelector indicates how payment method should be selected for this attempt
MethodSelector MethodSelector `json:"methodSelector" yaml:"methodSelector" validate:"oneof=primary backup all all-backup"`

// ConnectorRetryType indicates how the attempt should retry (on the same connector), if needed
ConnectorRetryType ConnectorRetryType `json:"connectorRetryType" yaml:"connectorRetryType" validate:"oneof='' token-pan pan-token"`

// ConnectorLimit is a maximum number of connectors to process within an attempt per method
ConnectorLimit int32 `json:"connectorLimit" yaml:"connectorLimit" validate:"min=0,max=1000"`

Expand Down
11 changes: 11 additions & 0 deletions v1/scheduler/enums.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,14 @@ const (
// DayShiftClosest move the date to the closest day
DayShiftClosest DayShift = "closest"
)

type ConnectorRetryType string

const (
// ConnectorRetryTypeNone No retry
ConnectorRetryTypeNone ConnectorRetryType = ""
// ConnectorRetryTypeTokenToPan Use the token first, cascade to Pan if available
ConnectorRetryTypeTokenToPan ConnectorRetryType = "token-pan"
// ConnectorRetryTypePanToToken Use the Pan first, cascade to Token if available
ConnectorRetryTypePanToToken ConnectorRetryType = "pan-token"
)