Commit 9ec2259e authored by Vincent Pelletier's avatar Vincent Pelletier

CMFActivity: Take activity age in queue priority.

Just like age is taken into account inside each activity queue.
parent 24df3ec5
......@@ -238,8 +238,8 @@ class SQLBase(Queue):
def getPriority(self, activity_tool):
result = activity_tool.SQLBase_getPriority(table=self.sql_table)
if result:
assert len(result) == 1, len(result)
return result[0]['priority']
result, = result
return result['priority'], result['date']
return Queue.getPriority(self, activity_tool)
def _retryOnLockError(self, method, args=(), kw={}):
......
......@@ -9,10 +9,10 @@ class_file:
</dtml-comment>
<params>table
</params>
SELECT `priority` FROM
SELECT `priority`, `date` FROM
<dtml-var table>
WHERE
processing_node = 0
AND date <= UTC_TIMESTAMP()
ORDER BY priority
ORDER BY priority, date
LIMIT 1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment