Skip to content

Commit

Permalink
Connector retry type (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb authored Oct 14, 2024
1 parent bf99bb5 commit 499ac4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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"
)

0 comments on commit 499ac4a

Please sign in to comment.