Commit ff4fa2a4 authored by Vincent Pelletier's avatar Vincent Pelletier

Revert commit 25259.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25260 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ee577a60
...@@ -7,8 +7,9 @@ cache_time:0 ...@@ -7,8 +7,9 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params> <params>path
processing_node processing_node
method_id
uid uid
</params> </params>
UPDATE message UPDATE message
...@@ -16,8 +17,14 @@ SET ...@@ -16,8 +17,14 @@ SET
processing_node=<dtml-sqlvar processing_node type="int">, processing_node=<dtml-sqlvar processing_node type="int">,
processing=0 processing=0
WHERE WHERE
<dtml-if uid>
uid IN ( uid IN (
<dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
<dtml-else>
processing_node = -1
AND path = <dtml-sqlvar path type="string">
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
</dtml-if>
<dtml-var sql_delimiter> <dtml-var sql_delimiter>
COMMIT COMMIT
...@@ -13,7 +13,8 @@ only_valid</params> ...@@ -13,7 +13,8 @@ only_valid</params>
SELECT count(path) as message_count FROM SELECT count(path) as message_count FROM
message message
WHERE WHERE
path = <dtml-sqlvar path type="string"> 1 = 1
<dtml-if expr="method_id is not None">AND method_id = <dtml-sqlvar method_id type="string"></dtml-if> <dtml-if path> AND path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if expr="only_valid">AND processing_node > -2</dtml-if> <dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-if only_valid>AND processing_node > -2</dtml-if>
...@@ -10,6 +10,7 @@ class_file: ...@@ -10,6 +10,7 @@ class_file:
<params>path <params>path
method_id method_id
processing_node processing_node
priority
include_processing include_processing
to_date to_date
offset:int=0 offset:int=0
...@@ -23,6 +24,7 @@ WHERE ...@@ -23,6 +24,7 @@ WHERE
AND processing = 0 AND processing = 0
</dtml-if> </dtml-if>
<dtml-if expr="processing_node is not None"> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if> <dtml-if expr="processing_node is not None"> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if priority> AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"> </dtml-if> <dtml-if path>AND path = <dtml-sqlvar path type="string"> </dtml-if>
<dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"> </dtml-if> <dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"> </dtml-if>
<dtml-if to_date> AND date <= <dtml-sqlvar to_date type="datetime"> </dtml-if> <dtml-if to_date> AND date <= <dtml-sqlvar to_date type="datetime"> </dtml-if>
......
...@@ -7,15 +7,19 @@ cache_time:0 ...@@ -7,15 +7,19 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params> <params>processing_node
method_id method_id
path path
to_date
order_validation_text order_validation_text
</params> group_method_id</params>
SELECT uid FROM SELECT uid FROM
message message
WHERE WHERE
processing = 0 processing = 0
<dtml-if expr="processing_node is not None"> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"> </dtml-if> <dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"> </dtml-if>
<dtml-if path> AND path = <dtml-sqlvar path type="string"> </dtml-if> <dtml-if path> AND path = <dtml-sqlvar path type="string"> </dtml-if>
<dtml-if to_date> AND date <= <dtml-sqlvar to_date type="datetime"> </dtml-if>
<dtml-if order_validation_text> AND order_validation_text = <dtml-sqlvar order_validation_text type="string"> </dtml-if> <dtml-if order_validation_text> AND order_validation_text = <dtml-sqlvar order_validation_text type="string"> </dtml-if>
<dtml-if group_method_id> AND group_method_id = <dtml-sqlvar group_method_id type="string"> </dtml-if>
...@@ -11,7 +11,7 @@ class_file: ...@@ -11,7 +11,7 @@ class_file:
to_date to_date
count count
group_method_id group_method_id
</params> order_validation_text</params>
UPDATE UPDATE
message message
SET SET
...@@ -20,6 +20,7 @@ WHERE ...@@ -20,6 +20,7 @@ WHERE
processing_node=0 processing_node=0
AND date <= <dtml-sqlvar to_date type="datetime"> AND date <= <dtml-sqlvar to_date type="datetime">
<dtml-if group_method_id> AND group_method_id = <dtml-sqlvar group_method_id type="string"> </dtml-if> <dtml-if group_method_id> AND group_method_id = <dtml-sqlvar group_method_id type="string"> </dtml-if>
<dtml-if order_validation_text> AND order_validation_text = <dtml-sqlvar order_validation_text type="string"> </dtml-if>
ORDER BY ORDER BY
priority, date, uid priority, date, uid
<dtml-if count> <dtml-if count>
......
...@@ -16,6 +16,6 @@ FROM ...@@ -16,6 +16,6 @@ FROM
WHERE WHERE
processing_node = <dtml-sqlvar processing_node type="int"> processing_node = <dtml-sqlvar processing_node type="int">
AND processing = 0 AND processing = 0
<dtml-if expr="count is not None"> <dtml-if count>
LIMIT <dtml-sqlvar count type="int"> LIMIT <dtml-sqlvar count type="int">
</dtml-if> </dtml-if>
...@@ -9,9 +9,11 @@ class_file: ...@@ -9,9 +9,11 @@ class_file:
</dtml-comment> </dtml-comment>
<params>uid:list <params>uid:list
priority priority
date
retry retry
delay delay
</params> processing_node
order_validation_text</params>
UPDATE UPDATE
message message
SET SET
...@@ -21,11 +23,22 @@ SET ...@@ -21,11 +23,22 @@ SET
</dtml-if> </dtml-if>
<dtml-if delay> <dtml-if delay>
, date = DATE_ADD(UTC_TIMESTAMP(), INTERVAL <dtml-sqlvar delay type="int"> * (retry + 1) SECOND) , date = DATE_ADD(UTC_TIMESTAMP(), INTERVAL <dtml-sqlvar delay type="int"> * (retry + 1) SECOND)
<dtml-elif date>
, date = <dtml-sqlvar date type="datetime">
</dtml-if> </dtml-if>
<dtml-if retry> <dtml-if retry>
, retry = retry + <dtml-sqlvar retry type="int"> , retry = retry + <dtml-sqlvar retry type="int">
</dtml-if> </dtml-if>
WHERE WHERE
uid IN ( 1 = 1
<dtml-if uid>
AND uid IN (
<dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if>
<dtml-if expr="_.getattr(_, 'processing_node', None) is not None">
AND processing_node = <dtml-sqlvar processing_node type="int">
</dtml-if>
<dtml-if order_validation_text>
AND order_validation_text = <dtml-sqlvar order_validation_text type="string">
</dtml-if>
...@@ -15,7 +15,7 @@ UPDATE ...@@ -15,7 +15,7 @@ UPDATE
SET SET
date = DATE_SUB(date, INTERVAL <dtml-sqlvar delay type="int"> SECOND), date = DATE_SUB(date, INTERVAL <dtml-sqlvar delay type="int"> SECOND),
processing_date = DATE_SUB(processing_date, INTERVAL <dtml-sqlvar delay type="int"> SECOND) processing_date = DATE_SUB(processing_date, INTERVAL <dtml-sqlvar delay type="int"> SECOND)
<dtml-if expr="retry is not None"> <dtml-if retry>
,retry = GREATEST(retry,<dtml-sqlvar retry type="int">) - <dtml-sqlvar retry type="int"> ,retry = GREATEST(retry,<dtml-sqlvar retry type="int">) - <dtml-sqlvar retry type="int">
</dtml-if> </dtml-if>
WHERE WHERE
......
...@@ -15,7 +15,7 @@ count ...@@ -15,7 +15,7 @@ count
serialization_tag serialization_tag
</params> </params>
SELECT SELECT
<dtml-if expr="count"> <dtml-if count>
COUNT(*) AS uid_count COUNT(*) AS uid_count
<dtml-else> <dtml-else>
* *
...@@ -24,23 +24,23 @@ FROM ...@@ -24,23 +24,23 @@ FROM
message message
WHERE WHERE
processing_node >= -2 processing_node >= -2
<dtml-if expr="method_id is not None"> <dtml-if method_id>
AND method_id IN ( AND method_id IN (
<dtml-in method_id><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in method_id><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if> </dtml-if>
<dtml-if expr="message_uid is not None">AND uid = <dtml-sqlvar message_uid type="int"> </dtml-if> <dtml-if message_uid>AND uid = <dtml-sqlvar message_uid type="int"> </dtml-if>
<dtml-if expr="path is not None"> <dtml-if path>
AND path IN ( AND path IN (
<dtml-in path><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in path><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if> </dtml-if>
<dtml-if expr="tag is not None"> <dtml-if tag>
AND tag IN ( AND tag IN (
<dtml-in tag><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in tag><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if> </dtml-if>
<dtml-if expr="serialization_tag is not None"> <dtml-if serialization_tag>
AND processing_node > -1 AND processing_node > -1
AND serialization_tag = <dtml-sqlvar serialization_tag type="string"> AND serialization_tag = <dtml-sqlvar serialization_tag type="string">
</dtml-if> </dtml-if>
...@@ -26,9 +26,9 @@ VALUES ...@@ -26,9 +26,9 @@ VALUES
( (
<dtml-sqlvar expr="uid_list[loop_item]" type="int">, <dtml-sqlvar expr="uid_list[loop_item]" type="int">,
<dtml-sqlvar expr="path_list[loop_item]" type="string">, <dtml-sqlvar expr="path_list[loop_item]" type="string">,
<dtml-if expr="date_list is not None"><dtml-if expr="date_list[loop_item] is not None"><dtml-sqlvar expr="date_list[loop_item]" type="datetime"><dtml-else>UTC_TIMESTAMP()</dtml-if><dtml-else>UTC_TIMESTAMP()</dtml-if>, <dtml-if date_list><dtml-if expr="date_list[loop_item] is not None"><dtml-sqlvar expr="date_list[loop_item]" type="datetime"><dtml-else>UTC_TIMESTAMP()</dtml-if><dtml-else>UTC_TIMESTAMP()</dtml-if>,
<dtml-sqlvar expr="method_id_list[loop_item]" type="string">, <dtml-sqlvar expr="method_id_list[loop_item]" type="string">,
<dtml-if expr="processing_node_list is not None"><dtml-sqlvar expr="processing_node_list[loop_item]" type="int"><dtml-else>-1</dtml-if>, <dtml-if processing_node_list><dtml-sqlvar expr="processing_node_list[loop_item]" type="int"><dtml-else>-1</dtml-if>,
0, 0,
<dtml-sqlvar expr="priority_list[loop_item]" type="int">, <dtml-sqlvar expr="priority_list[loop_item]" type="int">,
<dtml-sqlvar expr="group_method_id_list[loop_item]" type="string">, <dtml-sqlvar expr="group_method_id_list[loop_item]" type="string">,
......
...@@ -7,16 +7,21 @@ cache_time:0 ...@@ -7,16 +7,21 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params> <params>path
processing_node processing_node
method_id
uid</params> uid</params>
UPDATE message_queue UPDATE message_queue
SET SET
processing_node=<dtml-sqlvar processing_node type="int">, processing_node=<dtml-sqlvar processing_node type="int">,
processing=0 processing=0
WHERE WHERE
<dtml-if path> path = <dtml-sqlvar path type="string">
<dtml-else>
uid IN ( uid IN (
<dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in uid><dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if>
<dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-var sql_delimiter> <dtml-var sql_delimiter>
COMMIT COMMIT
...@@ -13,7 +13,8 @@ only_valid</params> ...@@ -13,7 +13,8 @@ only_valid</params>
SELECT count(path) as message_count FROM SELECT count(path) as message_count FROM
message_queue message_queue
WHERE WHERE
path = <dtml-sqlvar path type="string"> 1 = 1
<dtml-if expr="method_id is not None">AND method_id = <dtml-sqlvar method_id type="string"></dtml-if> <dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if expr="only_valid">AND processing_node > -2</dtml-if> <dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-if only_valid>AND processing_node > -2</dtml-if>
...@@ -10,6 +10,7 @@ class_file: ...@@ -10,6 +10,7 @@ class_file:
<params>path <params>path
method_id method_id
processing_node processing_node
priority
to_date to_date
offset:int=0 offset:int=0
count:int=1000 count:int=1000
...@@ -19,6 +20,7 @@ SELECT * FROM ...@@ -19,6 +20,7 @@ SELECT * FROM
WHERE WHERE
processing = 0 processing = 0
<dtml-if expr="processing_node is not None"> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if> <dtml-if expr="processing_node is not None"> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if priority>AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
<dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if> <dtml-if path>AND path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if> <dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-if to_date> AND date <= <dtml-sqlvar to_date type="datetime"> </dtml-if> <dtml-if to_date> AND date <= <dtml-sqlvar to_date type="datetime"> </dtml-if>
......
...@@ -20,6 +20,8 @@ WHERE ...@@ -20,6 +20,8 @@ WHERE
AND date <= <dtml-sqlvar to_date type="datetime"> AND date <= <dtml-sqlvar to_date type="datetime">
ORDER BY ORDER BY
priority, date, uid priority, date, uid
LIMIT <dtml-sqlvar count type="int"> <dtml-if count>
LIMIT <dtml-sqlvar count type="int">
</dtml-if>
<dtml-var sql_delimiter> <dtml-var sql_delimiter>
COMMIT COMMIT
...@@ -16,6 +16,6 @@ FROM ...@@ -16,6 +16,6 @@ FROM
WHERE WHERE
processing_node = <dtml-sqlvar processing_node type="int"> processing_node = <dtml-sqlvar processing_node type="int">
AND processing = 0 AND processing = 0
<dtml-if expr="count is not None"> <dtml-if count>
LIMIT <dtml-sqlvar count type="int"> LIMIT <dtml-sqlvar count type="int">
</dtml-if> </dtml-if>
...@@ -10,7 +10,7 @@ class_file: ...@@ -10,7 +10,7 @@ class_file:
<params>uid <params>uid
priority priority
delay delay
</params> date</params>
UPDATE UPDATE
message_queue message_queue
SET SET
...@@ -20,6 +20,8 @@ SET ...@@ -20,6 +20,8 @@ SET
</dtml-if> </dtml-if>
<dtml-if delay> <dtml-if delay>
, date = DATE_ADD(UTC_TIMESTAMP(), INTERVAL <dtml-sqlvar delay type="int"> SECOND) , date = DATE_ADD(UTC_TIMESTAMP(), INTERVAL <dtml-sqlvar delay type="int"> SECOND)
<dtml-elif date>
, date = <dtml-sqlvar date type="datetime">
</dtml-if> </dtml-if>
WHERE WHERE
uid IN ( uid IN (
......
...@@ -12,8 +12,8 @@ processing_node</params> ...@@ -12,8 +12,8 @@ processing_node</params>
UPDATE UPDATE
message_queue message_queue
SET SET
date = DATE_SUB(date, INTERVAL <dtml-sqlvar delay type="int"> SECOND), date = date - <dtml-sqlvar delay type="int">,
processing_date = DATE_SUB(processing_date, INTERVAL <dtml-sqlvar delay type="int"> SECOND) processing_date = processing_date - <dtml-sqlvar delay type="int">
WHERE WHERE
1 = 1 1 = 1
<dtml-if expr="processing_node is not None"> <dtml-if expr="processing_node is not None">
......
...@@ -15,7 +15,7 @@ count ...@@ -15,7 +15,7 @@ count
serialization_tag serialization_tag
</params> </params>
SELECT SELECT
<dtml-if expr="count"> <dtml-if count>
COUNT(*) AS uid_count COUNT(*) AS uid_count
<dtml-else> <dtml-else>
* *
...@@ -24,23 +24,23 @@ FROM ...@@ -24,23 +24,23 @@ FROM
message_queue message_queue
WHERE WHERE
processing_node >= -2 processing_node >= -2
<dtml-if expr="method_id is not None"> <dtml-if method_id>
AND method_id IN ( AND method_id IN (
<dtml-in method_id><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in method_id><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if> </dtml-if>
<dtml-if expr="message_uid is not None">AND uid = <dtml-sqlvar message_uid type="int"> </dtml-if> <dtml-if message_uid>AND uid = <dtml-sqlvar message_uid type="int"> </dtml-if>
<dtml-if expr="path is not None"> <dtml-if path>
AND path IN ( AND path IN (
<dtml-in path><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in path><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if> </dtml-if>
<dtml-if expr="tag is not None"> <dtml-if tag>
AND tag IN ( AND tag IN (
<dtml-in tag><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in> <dtml-in tag><dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
) )
</dtml-if> </dtml-if>
<dtml-if expr="serialization_tag is not None"> <dtml-if serialization_tag>
AND processing_node > -1 AND processing_node > -1
AND serialization_tag = <dtml-sqlvar serialization_tag type="string"> AND serialization_tag = <dtml-sqlvar serialization_tag type="string">
</dtml-if> </dtml-if>
...@@ -25,9 +25,9 @@ VALUES ...@@ -25,9 +25,9 @@ VALUES
( (
<dtml-sqlvar expr="uid_list[loop_item]" type="int">, <dtml-sqlvar expr="uid_list[loop_item]" type="int">,
<dtml-sqlvar expr="path_list[loop_item]" type="string">, <dtml-sqlvar expr="path_list[loop_item]" type="string">,
<dtml-if expr="date_list is not None"><dtml-if expr="date_list[loop_item] is not None"><dtml-sqlvar expr="date_list[loop_item]" type="datetime"><dtml-else>UTC_TIMESTAMP()</dtml-if><dtml-else>UTC_TIMESTAMP()</dtml-if>, <dtml-if date_list><dtml-if expr="date_list[loop_item] is not None"><dtml-sqlvar expr="date_list[loop_item]" type="datetime"><dtml-else>UTC_TIMESTAMP()</dtml-if><dtml-else>UTC_TIMESTAMP()</dtml-if>,
<dtml-sqlvar expr="method_id_list[loop_item]" type="string">, <dtml-sqlvar expr="method_id_list[loop_item]" type="string">,
<dtml-if expr="processing_node_list is not None"><dtml-sqlvar expr="processing_node_list[loop_item]" type="int"><dtml-else>-1</dtml-if>, <dtml-if processing_node_list><dtml-sqlvar expr="processing_node_list[loop_item]" type="int"><dtml-else>-1</dtml-if>,
0, 0,
<dtml-sqlvar expr="priority_list[loop_item]" type="int">, <dtml-sqlvar expr="priority_list[loop_item]" type="int">,
<dtml-sqlvar expr="tag_list[loop_item]" type="string">, <dtml-sqlvar expr="tag_list[loop_item]" type="string">,
......
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