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): ...@@ -57,7 +57,7 @@ class ActiveProcess(Base):
""" """
meta_type='CMF Active Process' meta_type='CMF Active Process'
portal_type=None # may be useful in the future... portal_type='Active Process'
isPortalContent = 0 isPortalContent = 0
isRADContent = 1 isRADContent = 1
icon = None icon = None
...@@ -94,7 +94,7 @@ class ActiveProcess(Base): ...@@ -94,7 +94,7 @@ class ActiveProcess(Base):
""" """
Returns the list of errors as text 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') security.declareProtected(CMFCorePermissions.ManagePortal, 'activateResult')
def activateResult(self, result): def activateResult(self, result):
......
...@@ -144,6 +144,7 @@ class ActivityTool (Folder, UniqueObject): ...@@ -144,6 +144,7 @@ class ActivityTool (Folder, UniqueObject):
""" """
id = 'portal_activities' id = 'portal_activities'
meta_type = 'CMF Activity Tool' meta_type = 'CMF Activity Tool'
portal_type = 'Activity Tool'
allowed_types = ( 'CMF Active Process', ) allowed_types = ( 'CMF Active Process', )
security = ClassSecurityInfo() security = ClassSecurityInfo()
...@@ -245,8 +246,13 @@ class ActivityTool (Folder, UniqueObject): ...@@ -245,8 +246,13 @@ class ActivityTool (Folder, UniqueObject):
active_threads -= 1 active_threads -= 1
tic_lock.release() tic_lock.release()
def hasActivity(self, object, **kw): def hasActivity(self, *args, **kw):
# Check in each queue if the object has deferred tasks # 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: for activity in activity_list:
if activity.hasActivity(self, object, **kw): if activity.hasActivity(self, object, **kw):
return 1 return 1
...@@ -310,11 +316,13 @@ class ActivityTool (Folder, UniqueObject): ...@@ -310,11 +316,13 @@ class ActivityTool (Folder, UniqueObject):
return message_list return message_list
security.declareProtected( CMFCorePermissions.ManagePortal , 'newActiveProcess' ) security.declareProtected( CMFCorePermissions.ManagePortal , 'newActiveProcess' )
def newActiveProcess(self): def newActiveProcess(self, **kw):
from ActiveProcess import addActiveProcess from ActiveProcess import addActiveProcess
new_id = str(self.generateNewId()) new_id = str(self.generateNewId())
addActiveProcess(self, new_id) 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): def reindexObject(self):
self.immediateReindexObject() self.immediateReindexObject()
......
#!/bin/bash #!/bin/bash
while true; do 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_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_distribute.out http://jp:jp@localhost:9573/coramy/portal_activities/distribute?node_count:int=3 &
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_distribute.out http://jp:jp@192.1.2.150:9573/coramy/portal_activities/distribute?node_count:int=1 &
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@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 sleep 5
done 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