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

[IMP] Add retry pattern for jobs #75

Closed
wants to merge 5 commits into
base: 8.0
from

Conversation

Projects
None yet
4 participants
@JosDeGraeve
Contributor

JosDeGraeve commented Jun 1, 2015

This adds a retry pattern for queue jobs.
see OCA/connector-magento#26

JosDeGraeve and others added some commits Jun 1, 2015

[IMP] Add retry pattern for jobs
This adds a retry pattern for queue jobs.
see OCA/connector-magento#26
FIX: sort the retry dictionairy by retry count
Sort the retry dict by key ( the retry count ) instead of by value
Keep the retry pattern on the @job definition rather than in jobs
It avoids to copy and to store the pattern for every job when all jobs of one
function will probably share the same pattern.
Use seconds of the higher retry count of the retry pattern
So that the last count is repeated indefinitely.
For the following pattern:
{1: 10*60,
 5: 20*60,
 10: 60*60}
The retries 1 to 4 will be postponed 10 minutes later.
The retries 5 to 9 will be postponed 20 minutes later.
The retries 10 to infinite will be postponed 1 hour later.
@guewen

This comment has been minimized.

Show comment
Hide comment
@guewen

guewen Jun 2, 2015

Member

I proposed some modifications on apertoso/connector#1

Member

guewen commented Jun 2, 2015

I proposed some modifications on apertoso/connector#1

@bguillot

This comment has been minimized.

Show comment
Hide comment
@bguillot

bguillot Jun 2, 2015

Contributor

Good idea
👍

Contributor

bguillot commented Jun 2, 2015

Good idea
👍

@nbessi

This comment has been minimized.

Show comment
Hide comment
@nbessi

nbessi Jun 4, 2015

Contributor

👍

Contributor

nbessi commented Jun 4, 2015

👍

@@ -76,6 +76,7 @@ class QueueJob(models.Model):
date_enqueued = fields.Datetime(string='Enqueue Time', readonly=True)
date_done = fields.Datetime(string='Date Done', readonly=True)
eta = fields.Datetime(string='Execute only after')
retry_pattern = fields.Char(string='Retry Pattern')

This comment has been minimized.

@guewen

guewen Jun 9, 2015

Member

I forgot to remove this field. Could remove it or merge https://github.com/apertoso/connector/pull/2?

@guewen

guewen Jun 9, 2015

Member

I forgot to remove this field. Could remove it or merge https://github.com/apertoso/connector/pull/2?

@guewen guewen referenced this pull request Jul 3, 2015

Merged

Add retry pattern for jobs #92

@guewen

This comment has been minimized.

Show comment
Hide comment
@guewen

guewen Jul 3, 2015

Member

Thanks for implementing this new feature!
I merged my PR apertoso#2 in a new branch #92 and will merge it as soon as it gets green.
👍

Member

guewen commented Jul 3, 2015

Thanks for implementing this new feature!
I merged my PR apertoso#2 in a new branch #92 and will merge it as soon as it gets green.
👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment