Commit ab68991e authored by Vincent Pelletier's avatar Vincent Pelletier

Rename "limit" parameter to ZSQLMethods into "count", as it is a special...

Rename "limit" parameter to ZSQLMethods into "count", as it is a special parameter name (interpreted outside of ZSQLMethod).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25253 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8b4509ae
...@@ -161,10 +161,10 @@ class SQLDict(RAMDict, SQLBase): ...@@ -161,10 +161,10 @@ class SQLDict(RAMDict, SQLBase):
This number is guaranted not to be exceeded. This number is guaranted not to be exceeded.
If None (or not given) no limit apply. If None (or not given) no limit apply.
""" """
result = activity_tool.SQLDict_selectReservedMessageList(processing_node=processing_node, limit=limit) result = activity_tool.SQLDict_selectReservedMessageList(processing_node=processing_node, count=limit)
if len(result) == 0: if len(result) == 0:
activity_tool.SQLDict_reserveMessageList(limit=limit, processing_node=processing_node, to_date=date, **kw) activity_tool.SQLDict_reserveMessageList(count=limit, processing_node=processing_node, to_date=date, **kw)
result = activity_tool.SQLDict_selectReservedMessageList(processing_node=processing_node, limit=limit) result = activity_tool.SQLDict_selectReservedMessageList(processing_node=processing_node, count=limit)
return result return result
def makeMessageListAvailable(self, activity_tool, uid_list): def makeMessageListAvailable(self, activity_tool, uid_list):
......
...@@ -110,10 +110,10 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -110,10 +110,10 @@ class SQLQueue(RAMQueue, SQLBase):
This number is guaranted not to be exceeded. This number is guaranted not to be exceeded.
If None (or not given) no limit apply. If None (or not given) no limit apply.
""" """
result = activity_tool.SQLQueue_selectReservedMessageList(processing_node=processing_node, limit=limit) result = activity_tool.SQLQueue_selectReservedMessageList(processing_node=processing_node, count=limit)
if len(result) == 0: if len(result) == 0:
activity_tool.SQLQueue_reserveMessageList(limit=limit, processing_node=processing_node, to_date=date) activity_tool.SQLQueue_reserveMessageList(count=limit, processing_node=processing_node, to_date=date)
result = activity_tool.SQLQueue_selectReservedMessageList(processing_node=processing_node, limit=limit) result = activity_tool.SQLQueue_selectReservedMessageList(processing_node=processing_node, count=limit)
return result return result
def makeMessageListAvailable(self, activity_tool, uid_list): def makeMessageListAvailable(self, activity_tool, uid_list):
...@@ -482,7 +482,7 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -482,7 +482,7 @@ class SQLQueue(RAMQueue, SQLBase):
now_date = self.getNow(activity_tool) now_date = self.getNow(activity_tool)
result = readMessageList(path=None, method_id=None, processing_node=-1, result = readMessageList(path=None, method_id=None, processing_node=-1,
to_date=now_date, include_processing=0, to_date=now_date, include_processing=0,
offset=offset, limit=READ_MESSAGE_LIMIT) offset=offset, count=READ_MESSAGE_LIMIT)
validated_count = 0 validated_count = 0
#TIME_begin = time() #TIME_begin = time()
while len(result) and validated_count < MAX_VALIDATED_LIMIT: while len(result) and validated_count < MAX_VALIDATED_LIMIT:
...@@ -503,7 +503,7 @@ class SQLQueue(RAMQueue, SQLBase): ...@@ -503,7 +503,7 @@ class SQLQueue(RAMQueue, SQLBase):
offset += READ_MESSAGE_LIMIT offset += READ_MESSAGE_LIMIT
result = readMessageList(path=None, method_id=None, processing_node=-1, result = readMessageList(path=None, method_id=None, processing_node=-1,
to_date=now_date, include_processing=0, to_date=now_date, include_processing=0,
offset=offset, limit=READ_MESSAGE_LIMIT) offset=offset, count=READ_MESSAGE_LIMIT)
#TIME_end = time() #TIME_end = time()
#LOG('SQLQueue.distribute', INFO, '%0.4fs : %i messages => %i distributables' % (TIME_end - TIME_begin, offset + len(result), validated_count)) #LOG('SQLQueue.distribute', INFO, '%0.4fs : %i messages => %i distributables' % (TIME_end - TIME_begin, offset + len(result), validated_count))
......
...@@ -9,7 +9,7 @@ class_file: ...@@ -9,7 +9,7 @@ class_file:
</dtml-comment> </dtml-comment>
<params>processing_node <params>processing_node
to_date to_date
limit count
group_method_id group_method_id
order_validation_text</params> order_validation_text</params>
UPDATE UPDATE
...@@ -23,8 +23,8 @@ WHERE ...@@ -23,8 +23,8 @@ WHERE
<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>
ORDER BY ORDER BY
priority, date, uid priority, date, uid
<dtml-if limit> <dtml-if count>
LIMIT <dtml-sqlvar limit type="int"> LIMIT <dtml-sqlvar count type="int">
</dtml-if> </dtml-if>
<dtml-var sql_delimiter> <dtml-var sql_delimiter>
COMMIT COMMIT
...@@ -8,7 +8,7 @@ class_name: ...@@ -8,7 +8,7 @@ class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>processing_node <params>processing_node
limit</params> count</params>
SELECT SELECT
* *
FROM FROM
...@@ -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 limit> <dtml-if count>
LIMIT <dtml-sqlvar limit type="int"> LIMIT <dtml-sqlvar count type="int">
</dtml-if> </dtml-if>
...@@ -9,7 +9,7 @@ class_file: ...@@ -9,7 +9,7 @@ class_file:
</dtml-comment> </dtml-comment>
<params>processing_node <params>processing_node
to_date to_date
limit count
</params> </params>
UPDATE UPDATE
message_queue message_queue
...@@ -20,8 +20,8 @@ WHERE ...@@ -20,8 +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
<dtml-if limit> <dtml-if count>
LIMIT <dtml-sqlvar limit type="int"> LIMIT <dtml-sqlvar count type="int">
</dtml-if> </dtml-if>
<dtml-var sql_delimiter> <dtml-var sql_delimiter>
COMMIT COMMIT
...@@ -8,7 +8,7 @@ class_name: ...@@ -8,7 +8,7 @@ class_name:
class_file: class_file:
</dtml-comment> </dtml-comment>
<params>processing_node <params>processing_node
limit</params> count</params>
SELECT SELECT
* *
FROM FROM
...@@ -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 limit> <dtml-if count>
LIMIT <dtml-sqlvar limit type="int"> LIMIT <dtml-sqlvar count type="int">
</dtml-if> </dtml-if>
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