Commit a67b514f authored by Jean-Paul Smets's avatar Jean-Paul Smets

Updated methods based on uid


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@395 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent af78c458
......@@ -9,11 +9,17 @@ class_file:
</dtml-comment>
<params>path
processing_node
method_id</params>
method_id
uid=None</params>
UPDATE message
SET
processing_node=<dtml-sqlvar processing_node type="int">,
processing=0
WHERE
<dtml-if uid>
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
<dtml-else>
path = <dtml-sqlvar path type="string">
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
\ No newline at end of file
<dtml-if method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
</dtml-if>
\ No newline at end of file
......@@ -9,15 +9,17 @@ class_file:
</dtml-comment>
<params></params>
CREATE TABLE `message` (
`uid` int(11) NOT NULL auto_increment,
`path` VARCHAR(255),
`method_id` VARCHAR(40),
`processing_node` INT DEFAULT -1,
`processing` INT DEFAULT 0,
`priority` INT DEFAULT 0,
`message` BLOB,
PRIMARY KEY (`uid`),
KEY `path` (`path`),
KEY `method_id` (`method_id`),
KEY `processing_node` (`processing_node`),
KEY `processing` (`processing`),
KEY `priority` (`priority`),
) TYPE = InnoDB;
) TYPE = InnoDB;
\ No newline at end of file
......@@ -7,14 +7,9 @@ cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
method_id
processing_node
processing</params>
<params>uid:list</params>
DELETE FROM
message
message
WHERE
path = <dtml-sqlvar path type="string">
<dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if>
<dtml-if processing> AND processing = 1</dtml-if>
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
\ No newline at end of file
......@@ -16,4 +16,5 @@ WHERE
<dtml-if path> 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>
......@@ -7,12 +7,9 @@ cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
method_id
processing_node</params>
<params>uid</params>
UPDATE message
SET processing=1
WHERE
path = <dtml-sqlvar path type="string">
AND method_id = <dtml-sqlvar method_id type="string">
AND processing_node = <dtml-sqlvar processing_node type="int">
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
\ No newline at end of file
......@@ -12,7 +12,9 @@ priority</params>
SELECT * FROM
message
WHERE
processing = 0
processing <> 1
<dtml-if processing_node> 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 priority> AND priority = <dtml-sqlvar priority type="int"> </dtml-if>
ORDER BY
priority
\ No newline at end of file
......@@ -12,10 +12,12 @@ method_id
processing_node
priority</params>
SELECT * FROM
message
message
WHERE
processing = 0
processing <> 1
<dtml-if processing_node>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 method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
GROUP BY
path, method_id, processing_node, processing
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:10000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>processing_node
method_id
path</params>
SELECT uid FROM
message
WHERE
processing <> 1
<dtml-if processing_node> 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 path>AND path = <dtml-sqlvar path type="string"></dtml-if>
\ No newline at end of file
......@@ -7,15 +7,13 @@ cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path
method_id
priority
processing_node</params>
<params>uid:list
priority</params>
UPDATE
message
SET
priority = <dtml-sqlvar priority type="int">
priority = <dtml-sqlvar priority type="int">,
processing = 0
WHERE
path = <dtml-sqlvar path type="string">
AND method_id = <dtml-sqlvar method_id type="string">
AND processing_node = <dtml-sqlvar processing_node type="int">
\ No newline at end of file
<dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
OR </dtml-if></dtml-in>
\ No newline at end of file
......@@ -9,8 +9,13 @@ class_file:
</dtml-comment>
<params>path
method_id
priority
message</params>
message
priority</params>
INSERT INTO message
VALUES
(<dtml-sqlvar path type="string">,<dtml-sqlvar method_id type="string">,-1,0,<dtml-sqlvar priority type="int">,<dtml-sqlvar message type="string">);
SET
path = <dtml-sqlvar path type="string">,
method_id = <dtml-sqlvar method_id type="string">,
processing_node = -1,
processing = -1,
priority = <dtml-sqlvar priority type="int">,
message = <dtml-sqlvar message type="string">
\ No newline at end of file
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