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

Global update with Coramy optimizations


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@525 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b95e701
......@@ -57,7 +57,7 @@ class ActiveProcess(Base):
"""
meta_type='CMF Active Process'
portal_type=None # may be useful in the future...
portal_type='Active Process'
isPortalContent = 0
isRADContent = 1
icon = None
......@@ -94,7 +94,7 @@ class ActiveProcess(Base):
"""
Returns the list of errors as text
"""
return '\n'.join(self.error_list)
return '\n'.join(map(lambda x:repr(x), self.error_list))
security.declareProtected(CMFCorePermissions.ManagePortal, 'activateResult')
def activateResult(self, result):
......
......@@ -144,6 +144,7 @@ class ActivityTool (Folder, UniqueObject):
"""
id = 'portal_activities'
meta_type = 'CMF Activity Tool'
portal_type = 'Activity Tool'
allowed_types = ( 'CMF Active Process', )
security = ClassSecurityInfo()
......@@ -245,8 +246,13 @@ class ActivityTool (Folder, UniqueObject):
active_threads -= 1
tic_lock.release()
def hasActivity(self, object, **kw):
def hasActivity(self, *args, **kw):
# Check in each queue if the object has deferred tasks
# if not argument is provided, then check on self
if len(args) > 0:
object = args[0]
else:
object = self
for activity in activity_list:
if activity.hasActivity(self, object, **kw):
return 1
......@@ -310,11 +316,13 @@ class ActivityTool (Folder, UniqueObject):
return message_list
security.declareProtected( CMFCorePermissions.ManagePortal , 'newActiveProcess' )
def newActiveProcess(self):
def newActiveProcess(self, **kw):
from ActiveProcess import addActiveProcess
new_id = str(self.generateNewId())
addActiveProcess(self, new_id)
return self._getOb(new_id)
active_process = self._getOb(new_id)
active_process.edit(**kw)
return active_process
def reindexObject(self):
self.immediateReindexObject()
......
#!/bin/bash
while true; do
wget -O /tmp/zope_distribute.out http://jp:jp@localhost:9573/coramy/portal_activities/distribute?node_count:int=3 &
wget -O /tmp/zope_distribute.out http://jp:jp@192.1.2.151:9473/coramy/portal_activities/distribute?node_count:int=1 &
#wget -O /tmp/zope_distribute.out http://jp:jp@localhost:9573/coramy/portal_activities/distribute?node_count:int=1 &
wget -O /tmp/zope_tic1.out http://jp:jp@localhost:9573/coramy/portal_activities/tic?processing_node:int=1 &
wget -O /tmp/zope_tic2.out http://jp:jp@192.1.2.150:9473/coramy/portal_activities/tic?processing_node:int=2 &
wget -O /tmp/zope_tic3.out http://jp:jp@192.1.2.150:9573/coramy/portal_activities/tic?processing_node:int=3 &
#wget -O /tmp/zope_distribute.out http://jp:jp@localhost:9573/coramy/portal_activities/distribute?node_count:int=3 &
#wget -O /tmp/zope_distribute.out http://jp:jp@192.1.2.150:9573/coramy/portal_activities/distribute?node_count:int=1 &
#wget -O /tmp/zope_distribute.out http://jp:jp@192.1.2.150:9573/coramy/portal_activities/distribute?node_count:int=4 &
#wget -O /tmp/zope_tic1.out http://jp:jp@localhost:9573/coramy/portal_activities/tic?processing_node:int=1 &
wget -O /tmp/zope_tic2.out http://jp:jp@192.1.2.151:9473/coramy/portal_activities/tic?processing_node:int=1
#wget -O /tmp/zope_tic2.out http://jp:jp@192.1.2.150:9473/coramy/portal_activities/tic?processing_node:int=1 &
#wget -O /tmp/zope_tic3.out http://jp:jp@192.1.2.150:9573/coramy/portal_activities/tic?processing_node:int=2 &
#wget -O /tmp/zope_tic2.out http://jp:jp@192.1.2.151:9473/coramy/portal_activities/tic?processing_node:int=3 &
#wget -O /tmp/zope_tic2.out http://jp:jp@192.1.2.152:9473/coramy/portal_activities/tic?processing_node:int=4 &
sleep 5
done
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