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

use enqueue instead of retry_job to reenqueue jobs #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GustavoCaso
Copy link
Contributor

@kirs I wanted to see if we can remove the call for retry_job and all the test will pass :)

I wanted to remove the use of retry_job because I plan on overwrite it on core to increase the number of attempts from the Retry module, to make sure are not retrying more than they should.

@GustavoCaso GustavoCaso requested a review from kirs April 15, 2019 02:27
@GustavoCaso GustavoCaso force-pushed the do-not-use-retry-job-to-reenqueue-job branch from ea7c15f to 0b226fb Compare April 15, 2019 02:28
@GustavoCaso GustavoCaso force-pushed the do-not-use-retry-job-to-reenqueue-job branch from 0b226fb to fc5657c Compare April 15, 2019 02:30
Copy link
Contributor

@kirs kirs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference, but AFAIK @rafaelfranca recommended we use retry_job for re-enqueueing.

Semantically, I agree that this is not a "retry" but rather a "re-enqueue".

@@ -150,7 +145,9 @@ def reenqueue_iteration_job
self.times_interrupted += 1

self.already_in_queue = true if respond_to?(:already_in_queue=)
retry_job

enqueue unless @enqueued
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You no-op enqueueing if @enqueued is set, but what about the rest of side-effects in that method? Why do they need to run if the job was already enqueued?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something you need the defined?(@enqueued) otherwise you will get a Ruby warning.

@rafaelfranca
Copy link
Member

rafaelfranca commented Apr 15, 2019

I'm not against this change, if the goal if to make retry_job make sure we don't retry more than we should and this is the only way to do 👍, but maybe we need a re_enqueue_job method as well to make this distinction clear.

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

Successfully merging this pull request may close these issues.

3 participants