Merge lp:~camptocamp/openerp-connector/7.0-assign_jobs_with_priority-1252681 into lp:~openerp-connector-core-editors/openerp-connector/7.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Merged
Merged at revision: 599
Proposed branch: lp:~camptocamp/openerp-connector/7.0-assign_jobs_with_priority-1252681
Merge into: lp:~openerp-connector-core-editors/openerp-connector/7.0
Diff against target: 13 lines (+2/-1)
1 file modified
connector/queue/model.py (+2/-1)
To merge this branch: bzr merge lp:~camptocamp/openerp-connector/7.0-assign_jobs_with_priority-1252681
Reviewer Review Type Date Requested Status
OpenERP Connector Core Editors Pending
Review via email: mp+195739@code.launchpad.net

Commit message

[FIX] assignment of jobs to workers respect the priority of the jobs

Description of the change

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'connector/queue/model.py'
--- connector/queue/model.py 2013-06-26 05:47:44 +0000
+++ connector/queue/model.py 2013-11-19 10:17:15 +0000
@@ -282,7 +282,8 @@
282 sql = ("SELECT id FROM queue_job "282 sql = ("SELECT id FROM queue_job "
283 "WHERE worker_id IS NULL "283 "WHERE worker_id IS NULL "
284 "AND state not in ('failed', 'done') "284 "AND state not in ('failed', 'done') "
285 "AND active = true ")285 "AND active = true "
286 "ORDER BY eta NULLS LAST, priority, date_created ")
286 if max_jobs is not None:287 if max_jobs is not None:
287 sql += ' LIMIT %d' % max_jobs288 sql += ' LIMIT %d' % max_jobs
288 sql += ' FOR UPDATE NOWAIT'289 sql += ' FOR UPDATE NOWAIT'