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
03a84340
Commit
03a84340
authored
Oct 27, 2017
by
Hardik Juneja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: Make ValidationErrorDelay overridable and change getResult to getResultDict
parent
670ea4e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
12 deletions
+16
-12
product/CMFActivity/ActiveProcess.py
product/CMFActivity/ActiveProcess.py
+9
-7
product/CMFActivity/Activity/Queue.py
product/CMFActivity/Activity/Queue.py
+1
-1
product/CMFActivity/Activity/SQLBase.py
product/CMFActivity/Activity/SQLBase.py
+1
-0
product/CMFActivity/Activity/SQLJoblib.py
product/CMFActivity/Activity/SQLJoblib.py
+0
-1
product/CMFActivity/joblib/CMFActivityParallelBackend.py
product/CMFActivity/joblib/CMFActivityParallelBackend.py
+5
-3
No files found.
product/CMFActivity/ActiveProcess.py
View file @
03a84340
...
...
@@ -146,21 +146,23 @@ class ActiveProcess(Base):
except
AttributeError
:
# BBB: self was created before implementation of __init__
return
[]
if
type
(
result_list
)
is
not
ConflictFreeLog
:
# BBB: result_list is IOBTree
if
type
(
result_list
)
is
not
ConflictFreeLog
:
# BBB: result_list is IOBTree or LOBTree
return
result_list
.
values
()
return
list
(
result_list
)
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'getResultDict'
)
def
getResultDict
(
self
,
**
kw
):
"""
Returns the result
with requested key else None
Returns the result
Dict
"""
try
:
result_list
=
self
.
result_list
result
=
result_list
[
key
]
except
KeyError
:
return
None
return
result
result_dict
=
self
.
result_dict
if
type
(
result_dict
)
is
not
ConflictFreeLog
:
return
result_dict
return
{}
except
AttributeError
:
return
{}
security
.
declareProtected
(
CMFCorePermissions
.
ManagePortal
,
'activateResult'
)
def
activateResult
(
self
,
result
):
...
...
product/CMFActivity/Activity/Queue.py
View file @
03a84340
...
...
@@ -43,7 +43,7 @@ INVALID_ORDER = 2
# Time global parameters
MAX_PROCESSING_TIME
=
900
# in seconds
VALIDATION_ERROR_DELAY
=
1
# in seconds
VALIDATION_ERROR_DELAY
=
1
5
# in seconds
class
Queue
(
object
):
"""
...
...
product/CMFActivity/Activity/SQLBase.py
View file @
03a84340
...
...
@@ -571,6 +571,7 @@ class SQLBase(Queue):
make_available_uid_list
=
[]
notify_user_list
=
[]
executed_uid_list
=
deletable_uid_list
if
uid_to_duplicate_uid_list_dict
is
not
None
:
for
m
in
message_list
:
if
m
.
getExecutionState
()
==
MESSAGE_NOT_EXECUTED
:
...
...
product/CMFActivity/Activity/SQLJoblib.py
View file @
03a84340
...
...
@@ -31,7 +31,6 @@ from functools import total_ordering
from
zLOG
import
LOG
,
TRACE
,
INFO
,
WARNING
,
ERROR
,
PANIC
from
SQLBase
import
SQLBase
,
sort_message_key
from
Products.CMFActivity.ActivityTool
import
Message
from
Queue
import
Queue
,
VALIDATION_ERROR_DELAY
,
VALID
,
INVALID_PATH
# Stop validating more messages when this limit is reached
MAX_VALIDATED_LIMIT
=
1000
...
...
product/CMFActivity/joblib/CMFActivityParallelBackend.py
View file @
03a84340
...
...
@@ -63,9 +63,10 @@ if ENABLE_JOBLIB:
self
.
callback
=
callback
def
get
(
self
,
timeout
=
None
):
if
self
.
active_process
.
getResult
(
self
.
active_process_sig
)
is
None
:
resultDict
=
self
.
active_process
.
getResultDict
()
if
not
resultDict
.
has_key
(
self
.
active_process_sig
):
raise
ConflictError
result
=
self
.
active_process
.
getResult
(
self
.
active_process_sig
)
.
result
result
=
resultDict
[
self
.
active_process_sig
]
.
result
if
isinstance
(
result
,
Exception
):
raise
result
...
...
@@ -96,7 +97,8 @@ if ENABLE_JOBLIB:
# create a signature and convert it to integer
sig
=
joblib_hash
(
batch
.
items
[
0
])
sigint
=
int
(
sig
,
16
)
%
(
10
**
16
)
if
not
self
.
active_process
.
getResult
(
sigint
):
resultDict
=
self
.
active_process
.
getResultDict
()
if
not
resultDict
.
has_key
(
sigint
):
joblib_result
=
portal_activities
.
activate
(
activity
=
'SQLJoblib'
,
tag
=
"joblib_%s"
%
active_process_id
,
signature
=
sig
,
...
...
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