Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d9b61936
authored
Feb 20, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/local_tasks: made abortable for async jobs
parent
0e9a8a65
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
circle/storage/tasks/local_tasks.py
+9
-2
No files found.
circle/storage/tasks/local_tasks.py
View file @
d9b61936
from
manager.mancelery
import
celery
from
celery.contrib.abortable
import
AbortableTask
@celery.task
...
...
@@ -35,9 +36,15 @@ def restore(disk, user):
disk
.
restore
(
task_uuid
=
restore
.
request
.
id
,
user
=
user
)
@celery.task
def
create_from_url
(
Disk
,
url
,
params
,
user
):
class
create_from_url
(
AbortableTask
):
def
run
(
self
,
**
kwargs
):
Disk
=
kwargs
[
'cls'
]
url
=
kwargs
[
'url'
]
params
=
kwargs
[
'params'
]
user
=
kwargs
[
'user'
]
Disk
.
create_from_url
(
url
=
url
,
params
=
params
,
task_uuid
=
create_from_url
.
request
.
id
,
abortable_task
=
self
,
user
=
user
)
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