Resolve can_start from the client side and the signaler side

This commit is contained in:
Matthew Jones 2014-03-24 09:47:17 -04:00
parent 6941d89502
commit af231cc8b7
2 changed files with 3 additions and 2 deletions

View File

@ -237,6 +237,7 @@ def process_graph(graph, task_capacity):
if not start_status:
node_obj.status = 'failed'
node_obj.result_traceback += "Task failed pre-start check"
node_obj.save()
# TODO: Run error handler
continue
remaining_volume -= impact

View File

@ -370,7 +370,7 @@ class CommonTask(PrimordialModel):
@property
def can_start(self):
return bool(self.status == 'new')
return bool(self.status in ('new', 'waiting'))
@property
def task_impact(self):
@ -397,7 +397,7 @@ class CommonTask(PrimordialModel):
def start(self, error_callback, **kwargs):
task_class = self._get_task_class()
if not self.can_start:
if not self.status == 'waiting':
return False
needed = self._get_passwords_needed_to_start()
try: