Commit c5c8a957 by Dudás Ádám Committed by cloud

storage: fix abortable task implementation

parent 0edc8ff2
......@@ -36,18 +36,18 @@ def restore(disk, user):
disk.restore(task_uuid=restore.request.id, user=user)
class create_from_url(AbortableTask):
class CreateFromURLTask(AbortableTask):
def __init__(self):
self.bind(celery)
def run(self, **kwargs):
Disk = kwargs['cls']
url = kwargs['url']
params = kwargs['params']
user = kwargs['user']
Disk.create_from_url(url=url,
params=params,
Disk = kwargs.pop('cls')
Disk.create_from_url(url=kwargs.pop('url'),
task_uuid=create_from_url.request.id,
abortable_task=self,
user=user)
**kwargs)
create_from_url = CreateFromURLTask()
@celery.task
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment