Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
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
be81cdd9
authored
Sep 11, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: refactor activity code construction
parent
78b8228f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
circle/common/models.py
+8
-0
circle/vm/models/activity.py
+1
-1
No files found.
circle/common/models.py
View file @
be81cdd9
...
...
@@ -214,6 +214,14 @@ class ActivityModel(TimeStampedModel):
self
.
result_data
=
None
if
value
is
None
else
value
.
to_dict
()
@classmethod
def
construct_activity_code
(
cls
,
code_suffix
,
sub_suffix
=
None
):
code
=
join_activity_code
(
cls
.
ACTIVITY_CODE_BASE
,
code_suffix
)
if
sub_suffix
:
return
join_activity_code
(
code
,
sub_suffix
)
else
:
return
code
@celery.task
()
def
compute_cached
(
method
,
instance
,
memcached_seconds
,
...
...
circle/vm/models/activity.py
View file @
be81cdd9
...
...
@@ -99,7 +99,7 @@ class InstanceActivity(ActivityModel):
if
concurrency_check
and
active_activities
.
exists
():
raise
ActivityInProgressError
.
create
(
active_activities
[
0
])
activity_code
=
join_activity_code
(
cls
.
ACTIVITY_CODE_BASE
,
code_suffix
)
activity_code
=
cls
.
construct_activity_code
(
code_suffix
)
act
=
cls
(
activity_code
=
activity_code
,
instance
=
instance
,
parent
=
None
,
resultant_state
=
resultant_state
,
started
=
timezone
.
now
(),
readable_name_data
=
readable_name
.
to_dict
(),
...
...
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