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): ...@@ -238,8 +238,8 @@ class SQLBase(Queue):
def getPriority(self, activity_tool): def getPriority(self, activity_tool):
result = activity_tool.SQLBase_getPriority(table=self.sql_table) result = activity_tool.SQLBase_getPriority(table=self.sql_table)
if result: if result:
assert len(result) == 1, len(result) result, = result
return result[0]['priority'] return result['priority'], result['date']
return Queue.getPriority(self, activity_tool) return Queue.getPriority(self, activity_tool)
def _retryOnLockError(self, method, args=(), kw={}): def _retryOnLockError(self, method, args=(), kw={}):
......
...@@ -9,10 +9,10 @@ class_file: ...@@ -9,10 +9,10 @@ class_file:
</dtml-comment> </dtml-comment>
<params>table <params>table
</params> </params>
SELECT `priority` FROM SELECT `priority`, `date` FROM
<dtml-var table> <dtml-var table>
WHERE WHERE
processing_node = 0 processing_node = 0
AND date <= UTC_TIMESTAMP() AND date <= UTC_TIMESTAMP()
ORDER BY priority ORDER BY priority, date
LIMIT 1 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