Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
2c6004f5
Commit
2c6004f5
authored
Mar 15, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use modification_date to reduce checking too many object in case of massive reindex.
Use query syntax.
parent
1a2e1450
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updatePersonOpenOrder.xml
...m/portal_skins/vifib_slap/Alarm_updatePersonOpenOrder.xml
+5
-8
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Person_storeOpenOrderJournal.xml
.../portal_skins/vifib_slap/Person_storeOpenOrderJournal.xml
+5
-9
No files found.
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updatePersonOpenOrder.xml
View file @
2c6004f5
...
...
@@ -50,34 +50,31 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
if params is None:\n
<value>
<string>
if params is None:\n
params = {}\n
kw = {}\n
\n
from DateTime import DateTime\n
from Products.ZSQLCatalog.SQLCatalog import Query\n
\n
last_active_process = context.getLastActiveProcess()\n
if last_active_process is not None and params.get(\'full\', False):\n
# fetch only objects modified since last alarm run\n
kw[\'
indexation_timestamp\'] = \'>
= %s\' % last_active_process.getStartDate().ISO(
)\n
kw[\'
modification_date\'] = Query(modification_date=last_active_process.getStartDate(), range="min"
)\n
\n
# register active process in order to have "windows" of last indexed objects\n
context.newActiveProcess()\n
\n
context.getPortalObject().portal_catalog.searchAndActivate(\n
method_id=\'Person_storeOpenOrderJournal\',\n
method_kw={\'
indexation_timestamp\': kw.get(\'indexation_timestamp
\'), \'tag\': tag, \'stop_date\': params.get(\'stop_date\')},\n
method_kw={\'
modification_date\': kw.get(\'modification_date
\'), \'tag\': tag, \'stop_date\': params.get(\'stop_date\')},\n
activate_kw={\'tag\': tag, \'priority\': 10},\n
packet_size=1, # Person_storeOpenOrderJournal generates big transactions\n
portal_type=\'Person\'\n
)\n
\n
context.activate(after_tag=tag).getId()\n
]]>
</string>
</value>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
...
...
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Person_storeOpenOrderJournal.xml
View file @
2c6004f5
...
...
@@ -50,9 +50,7 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
person = context\n
<value>
<string>
person = context\n
portal = context.getPortalObject()\n
catalog = portal.portal_catalog\n
\n
...
...
@@ -62,8 +60,8 @@ setup_resource_uid = portal.restrictedTraverse(portal.portal_preferences.getPref
person_uid = person.getUid()\n
\n
kw = {}\n
if
indexation_timestamp
is not None:\n
kw[\'
indexation_timestamp\'] = ">
= %s" % indexation_timestamp
\n
if
modification_date
is not None:\n
kw[\'
modification_date\'] = Query(modification_date=modification_date, range="min")
\n
\n
remove_hosting_list = []\n
add_kw_list = []\n
...
...
@@ -126,13 +124,11 @@ for setup_line in catalog(\n
result = person.Person_updateOpenOrder(src__=src__, remove_hosting_list=remove_hosting_list, add_kw_list=add_kw_list, start_date_tuple_list=start_date_tuple_list, stop_date=stop_date)\n
from pprint import pformat\n
return pformat(result)\n
]]>
</string>
</value>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
src__=0,
indexation_timestamp
=None, tag=None, stop_date=None
</string>
</value>
<value>
<string>
src__=0,
modification_date
=None, tag=None, stop_date=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment