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: ...@@ -9,11 +9,17 @@ class_file:
</dtml-comment> </dtml-comment>
<params>path <params>path
processing_node processing_node
method_id</params> method_id
uid=None</params>
UPDATE message UPDATE message
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 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"> path = <dtml-sqlvar path type="string">
<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>
\ No newline at end of file </dtml-if>
\ No newline at end of file
...@@ -9,15 +9,17 @@ class_file: ...@@ -9,15 +9,17 @@ class_file:
</dtml-comment> </dtml-comment>
<params></params> <params></params>
CREATE TABLE `message` ( CREATE TABLE `message` (
`uid` int(11) NOT NULL auto_increment,
`path` VARCHAR(255), `path` VARCHAR(255),
`method_id` VARCHAR(40), `method_id` VARCHAR(40),
`processing_node` INT DEFAULT -1, `processing_node` INT DEFAULT -1,
`processing` INT DEFAULT 0, `processing` INT DEFAULT 0,
`priority` INT DEFAULT 0, `priority` INT DEFAULT 0,
`message` BLOB, `message` BLOB,
PRIMARY KEY (`uid`),
KEY `path` (`path`), KEY `path` (`path`),
KEY `method_id` (`method_id`), KEY `method_id` (`method_id`),
KEY `processing_node` (`processing_node`), KEY `processing_node` (`processing_node`),
KEY `processing` (`processing`), KEY `processing` (`processing`),
KEY `priority` (`priority`), KEY `priority` (`priority`),
) TYPE = InnoDB; ) TYPE = InnoDB;
\ No newline at end of file
...@@ -7,14 +7,9 @@ cache_time:0 ...@@ -7,14 +7,9 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>path <params>uid:list</params>
method_id
processing_node
processing</params>
DELETE FROM DELETE FROM
message message
WHERE WHERE
path = <dtml-sqlvar path type="string"> <dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
<dtml-if method_id> AND method_id = <dtml-sqlvar method_id type="string"></dtml-if> </dtml-in>
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if> \ No newline at end of file
<dtml-if processing> AND processing = 1</dtml-if>
...@@ -16,4 +16,5 @@ WHERE ...@@ -16,4 +16,5 @@ WHERE
<dtml-if path> path = <dtml-sqlvar path type="string"></dtml-if> <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 method_id>AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
</dtml-if> </dtml-if>
...@@ -7,12 +7,9 @@ cache_time:0 ...@@ -7,12 +7,9 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>path <params>uid</params>
method_id
processing_node</params>
UPDATE message UPDATE message
SET processing=1 SET processing=1
WHERE WHERE
path = <dtml-sqlvar path type="string"> <dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
AND method_id = <dtml-sqlvar method_id type="string"> OR </dtml-if></dtml-in>
AND processing_node = <dtml-sqlvar processing_node type="int"> \ No newline at end of file
...@@ -12,7 +12,9 @@ priority</params> ...@@ -12,7 +12,9 @@ priority</params>
SELECT * FROM SELECT * FROM
message message
WHERE WHERE
processing = 0 processing <> 1
<dtml-if processing_node> AND processing_node = <dtml-sqlvar processing_node type="int"></dtml-if> <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 ...@@ -12,10 +12,12 @@ method_id
processing_node processing_node
priority</params> priority</params>
SELECT * FROM SELECT * FROM
message message
WHERE WHERE
processing = 0 processing <> 1
<dtml-if processing_node>AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if> <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>
<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>
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 ...@@ -7,15 +7,13 @@ cache_time:0
class_name: class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>path <params>uid:list
method_id priority</params>
priority
processing_node</params>
UPDATE UPDATE
message message
SET SET
priority = <dtml-sqlvar priority type="int"> priority = <dtml-sqlvar priority type="int">,
processing = 0
WHERE WHERE
path = <dtml-sqlvar path type="string"> <dtml-in uid>uid = <dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else>
AND method_id = <dtml-sqlvar method_id type="string"> OR </dtml-if></dtml-in>
AND processing_node = <dtml-sqlvar processing_node type="int"> \ No newline at end of file
\ No newline at end of file
...@@ -9,8 +9,13 @@ class_file: ...@@ -9,8 +9,13 @@ class_file:
</dtml-comment> </dtml-comment>
<params>path <params>path
method_id method_id
priority message
message</params> priority</params>
INSERT INTO message INSERT INTO message
VALUES SET
(<dtml-sqlvar path type="string">,<dtml-sqlvar method_id type="string">,-1,0,<dtml-sqlvar priority type="int">,<dtml-sqlvar message type="string">); 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