Skip to content
Open
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
8 changes: 4 additions & 4 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ type controller struct {
ctx context.Context
cancel func()
ig IntervalGenerator
maxRetries int
maxRetries int64
mu *sync.RWMutex
next chan struct{} // user-facing channel
resetTimer chan time.Duration
retries int
retries int64
timer *time.Timer
}

func newController(ctx context.Context, ig IntervalGenerator, options ...ControllerOption) *controller {
cctx, cancel := context.WithCancel(ctx) // DO NOT fire this cancel here

maxRetries := 10
maxRetries := int64(10)
for _, option := range options {
switch option.Ident() {
case identMaxRetries{}:
maxRetries = option.Value().(int)
maxRetries = option.Value().(int64)
}
}

Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (*commonOption) exponentialOption() {}
// of each policy.
//
// This option can be passed to all policy constructors except for NullPolicy
func WithMaxRetries(v int) ControllerOption {
func WithMaxRetries(v int64) ControllerOption {
return &controllerOption{option.New(identMaxRetries{}, v)}
}

Expand Down