-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace ETA with delay #28
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,29 +5,8 @@ import ( | |
"time" | ||
) | ||
|
||
// ErrRetryTaskLater ... | ||
type ErrRetryTaskLater struct { | ||
name, msg string | ||
retryIn time.Duration | ||
} | ||
|
||
// RetryIn returns time.Duration from now when task should be retried | ||
func (e ErrRetryTaskLater) RetryIn() time.Duration { | ||
return e.retryIn | ||
} | ||
|
||
// Error implements the error interface | ||
func (e ErrRetryTaskLater) Error() string { | ||
return fmt.Sprintf("Task error: %s Will retry in: %s", e.msg, e.retryIn) | ||
} | ||
|
||
// NewErrRetryTaskLater returns new ErrRetryTaskLater instance | ||
func NewErrRetryTaskLater(msg string, retryIn time.Duration) ErrRetryTaskLater { | ||
return ErrRetryTaskLater{msg: msg, retryIn: retryIn} | ||
} | ||
|
||
// Retriable is interface that retriable errors should implement | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for fixing this cursed word most of all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought that I'd invented this spelling and was sitting here wondering what was wrong with me, but I just checked and it actually wasn't me and I feel a whole lot better about myself now. |
||
type Retriable interface { | ||
// Retryable is interface that retryable errors should implement | ||
type Retryable interface { | ||
RetryIn() time.Duration | ||
error | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer use
ErrRetryTaskLater
-- we always useErrKeepAndRetryTaskLater