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
1186a65a
Commit
1186a65a
authored
Dec 05, 2017
by
Hardik Juneja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: Allow optional signature parameter
parent
b1517b84
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
product/CMFActivity/Activity/Queue.py
product/CMFActivity/Activity/Queue.py
+6
-0
product/CMFActivity/Activity/SQLBase.py
product/CMFActivity/Activity/SQLBase.py
+1
-1
product/CMFActivity/Activity/SQLJoblib.py
product/CMFActivity/Activity/SQLJoblib.py
+2
-1
product/CMFActivity/tests/testCMFActivity.py
product/CMFActivity/tests/testCMFActivity.py
+2
-2
No files found.
product/CMFActivity/Activity/Queue.py
View file @
1186a65a
...
...
@@ -83,6 +83,12 @@ class Queue(object):
def
initialize
(
self
,
activity_tool
,
clear
):
pass
def
register
(
self
,
activity_buffer
,
activity_tool
,
message
):
pass
def
activateResult
(
self
,
active_process
,
result
,
signature
=
None
):
pass
def
deleteMessage
(
self
,
activity_tool
,
m
):
if
not
getattr
(
m
,
'is_deleted'
,
0
):
# We try not to delete twice
...
...
product/CMFActivity/Activity/SQLBase.py
View file @
1186a65a
product/CMFActivity/Activity/SQLJoblib.py
View file @
1186a65a
...
...
@@ -81,6 +81,7 @@ class SQLJoblib(SQLDict):
"""
assert
not
message
.
is_registered
,
message
message
.
is_registered
=
True
if
not
'signature'
in
message
.
activity_kw
:
message
.
activity_kw
[
'signature'
]
=
sqljoblib_hash
(
message
.
args
)
if
activity_buffer
.
activity_tool
is
None
:
self
.
activity_tool
=
activity_tool
...
...
product/CMFActivity/tests/testCMFActivity.py
View file @
1186a65a
...
...
@@ -2112,11 +2112,11 @@ class TestCMFActivity(ERP5TypeTestCase, LogInterceptor):
try
:
# Adds two same activities.
activity_tool
.
activate
(
activity
=
'SQLJoblib'
,
after_tag
=
'foo'
,
priority
=
2
,
tag
=
'a'
,
signature
=
555666
).
doSomething
(
other_tag
=
'a'
)
tag
=
'a'
).
doSomething
(
other_tag
=
'a'
)
self
.
commit
()
uid1
,
=
[
x
.
uid
for
x
in
activity_tool
.
getMessageList
()]
activity_tool
.
activate
(
activity
=
'SQLJoblib'
,
after_tag
=
'bar'
,
priority
=
1
,
tag
=
'a'
,
signature
=
555666
).
doSomething
(
other_tag
=
'a'
)
tag
=
'a'
).
doSomething
(
other_tag
=
'a'
)
self
.
commit
()
self
.
assertEqual
(
len
(
activity_tool
.
getMessageList
()),
2
)
activity_tool
.
distribute
()
...
...
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