Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1a278f49
authored
Feb 06, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add params for abort and commit handlers to activity constructors
parent
c381ac63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
circle/vm/models/activity.py
+8
-4
No files found.
circle/vm/models/activity.py
View file @
1a278f49
...
@@ -62,7 +62,8 @@ class InstanceActivity(ActivityModel):
...
@@ -62,7 +62,8 @@ class InstanceActivity(ActivityModel):
return
act
return
act
@contextmanager
@contextmanager
def
sub_activity
(
self
,
code_suffix
,
task_uuid
=
None
):
def
sub_activity
(
self
,
code_suffix
,
on_abort
=
None
,
on_commit
=
None
,
task_uuid
=
None
):
# Check for concurrent activities
# Check for concurrent activities
active_children
=
self
.
children
.
filter
(
finished__isnull
=
True
)
active_children
=
self
.
children
.
filter
(
finished__isnull
=
True
)
...
@@ -70,11 +71,13 @@ class InstanceActivity(ActivityModel):
...
@@ -70,11 +71,13 @@ class InstanceActivity(ActivityModel):
raise
ActivityInProgressError
(
active_children
[
0
])
raise
ActivityInProgressError
(
active_children
[
0
])
act
=
self
.
create_sub
(
code_suffix
,
task_uuid
)
act
=
self
.
create_sub
(
code_suffix
,
task_uuid
)
return
activitycontextimpl
(
act
)
return
activitycontextimpl
(
act
,
on_abort
=
on_abort
,
on_commit
=
on_commit
)
@contextmanager
@contextmanager
def
instance_activity
(
code_suffix
,
instance
,
task_uuid
=
None
,
user
=
None
):
def
instance_activity
(
code_suffix
,
instance
,
on_abort
=
None
,
on_commit
=
None
,
task_uuid
=
None
,
user
=
None
):
# Check for concurrent activities
# Check for concurrent activities
active_activities
=
instance
.
activity_log
.
filter
(
finished__isnull
=
True
)
active_activities
=
instance
.
activity_log
.
filter
(
finished__isnull
=
True
)
...
@@ -82,7 +85,8 @@ def instance_activity(code_suffix, instance, task_uuid=None, user=None):
...
@@ -82,7 +85,8 @@ def instance_activity(code_suffix, instance, task_uuid=None, user=None):
raise
ActivityInProgressError
(
active_activities
[
0
])
raise
ActivityInProgressError
(
active_activities
[
0
])
act
=
InstanceActivity
.
create
(
code_suffix
,
instance
,
task_uuid
,
user
)
act
=
InstanceActivity
.
create
(
code_suffix
,
instance
,
task_uuid
,
user
)
return
activitycontextimpl
(
act
)
return
activitycontextimpl
(
act
,
on_abort
=
on_abort
,
on_commit
=
on_commit
)
class
NodeActivity
(
ActivityModel
):
class
NodeActivity
(
ActivityModel
):
...
...
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