Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
10465221
Commit
10465221
authored
Feb 14, 2018
by
Hardik Juneja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: move Base_callSafeFunction from script to a method _callSafeFunction on activity_tool
parent
f79085ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+4
-0
product/CMFActivity/joblib/CMFActivityParallelBackend.py
product/CMFActivity/joblib/CMFActivityParallelBackend.py
+1
-3
No files found.
product/CMFActivity/ActivityTool.py
View file @
10465221
...
@@ -660,6 +660,10 @@ class ActivityTool (Folder, UniqueObject):
...
@@ -660,6 +660,10 @@ class ActivityTool (Folder, UniqueObject):
for
activity
in
activity_dict
.
itervalues
():
for
activity
in
activity_dict
.
itervalues
():
activity
.
initialize
(
self
,
clear
=
False
)
activity
.
initialize
(
self
,
clear
=
False
)
def
_callSafeFunction
(
self
,
batch_function
):
result
=
batch_function
()
return
ActiveResult
(
result
=
result
)
security
.
declareProtected
(
Permissions
.
manage_properties
,
'isSubscribed'
)
security
.
declareProtected
(
Permissions
.
manage_properties
,
'isSubscribed'
)
def
isSubscribed
(
self
):
def
isSubscribed
(
self
):
"""
"""
...
...
product/CMFActivity/joblib/CMFActivityParallelBackend.py
View file @
10465221
...
@@ -99,7 +99,7 @@ else:
...
@@ -99,7 +99,7 @@ else:
if
not
resultDict
.
has_key
(
sig
):
if
not
resultDict
.
has_key
(
sig
):
joblib_result
=
portal_activities
.
activate
(
activity
=
'SQLJoblib'
,
joblib_result
=
portal_activities
.
activate
(
activity
=
'SQLJoblib'
,
tag
=
"joblib_%s"
%
active_process_id
,
tag
=
"joblib_%s"
%
active_process_id
,
active_process
=
self
.
active_process
).
Base
_callSafeFunction
(
JoblibSafeFunction
(
batch
))
active_process
=
self
.
active_process
).
_callSafeFunction
(
JoblibSafeFunction
(
batch
))
if
joblib_result
is
None
:
if
joblib_result
is
None
:
joblib_result
=
CMFActivityResult
(
self
.
active_process
,
sig
,
callback
)
joblib_result
=
CMFActivityResult
(
self
.
active_process
,
sig
,
callback
)
return
joblib_result
return
joblib_result
...
@@ -108,8 +108,6 @@ else:
...
@@ -108,8 +108,6 @@ else:
"""Reconfigure the backend and return the number of workers. This
"""Reconfigure the backend and return the number of workers. This
makes it possible to reuse an existing backend instance for successive
makes it possible to reuse an existing backend instance for successive
independent calls to Parallel with different parameters."""
independent calls to Parallel with different parameters."""
LOG
(
"CMFActivityBackend"
,
INFO
,
'n_jobs={}'
.
format
(
n_jobs
))
LOG
(
"CMFActivityBackend"
,
INFO
,
'parallel={}'
.
format
(
parallel
))
if
n_jobs
==
1
:
if
n_jobs
==
1
:
raise
FallbackToBackend
(
SequentialBackend
())
raise
FallbackToBackend
(
SequentialBackend
())
...
...
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