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

Retry options #68

Open
wayt opened this issue Aug 18, 2016 · 2 comments
Open

Retry options #68

wayt opened this issue Aug 18, 2016 · 2 comments

Comments

@wayt
Copy link

wayt commented Aug 18, 2016

Hi,

I've been looking at the retry options and I've face something strange. Maybe I just misunderstood.

In https://github.com/jrallison/go-workers/blob/master/enqueue.go#L24 you can specify if you wish to retry the task, and the max number of retry.
But, in https://github.com/jrallison/go-workers/blob/master/middleware_retry.go#L58 the retry_count option is used as the actual number of time the job have been tried.
With this, we can't configure a custom retry count, and I don't really see the point of the RetryCount in EnqueueOptions.

Thanks

@rowland
Copy link

rowland commented May 16, 2017

If I'm reading the sidekiq code correctly, retry_count is indeed the current count. Sidekiq allows the retry value to be either a boolean or an integer. go-workers accepts either boolean or integer values in the queued jobs, but only allows the retry option to be specified as a boolean from Go clients. So, your choices are 25 or 0.

rahuljayaraman added a commit to rahuljayaraman/go-workers that referenced this issue Apr 24, 2018
set retry to EnqueueOptions.RetryCount
fixes: jrallison#68
@rahuljayaraman
Copy link

rahuljayaraman commented Apr 25, 2018

@rowland would you know why go-workers would allow setting RetryCount (retry_count) directly through EnqeueOptions? Seems to me as if EnqueueOptions should only be setting retry. The retry middleware seems to increment retry-count from the message.

func incrementRetry(message *Msg) (retryCount int) {

I tried to fix it by using RetryCount set to retry here.

rahuljayaraman@5b58974

rahuljayaraman added a commit to rahuljayaraman/go-workers that referenced this issue Apr 25, 2018
set retry to EnqueueOptions.RetryCount
fixes: jrallison#68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants