diff --git a/beat/web/backend/schedule.py b/beat/web/backend/schedule.py index 6abdaa3ba7c76581e0b4ff6a606646200bfef268..dd3c0e0975e2831310890e4a71f419a7e1839c0f 100644 --- a/beat/web/backend/schedule.py +++ b/beat/web/backend/schedule.py @@ -66,8 +66,8 @@ def _select_splits_for_queue(queue): ''' - splits = JobSplits.objects.filter(job__block__queue=queue, - job__split_error=0, status=Job.QUEUED).order_by('job__runnable_date') + splits = JobSplit.objects.filter(job__block__queue=queue, + job__split_errors=0, status=Job.QUEUED).order_by('job__runnable_date') # lists of all users currently running users = set(splits.values_list('job__block__experiment__author', flat=True)) @@ -82,9 +82,9 @@ def _select_splits_for_queue(queue): # limit runnable splits so we reach a maximum of allowed user slots splits_to_consider = [] for s in splits: - author = j.job.block.experiment.author + author = s.job.block.experiment.author.id if allowance[author] > 0: - splits_to_consider.append(j) + splits_to_consider.append(s) allowance[author] -= 1 # TODO: Sort splits taking into consideration current user load @@ -190,7 +190,7 @@ def schedule(): ','.join([k.name for k in sorted_queues])) splits_to_consider = \ - [self._select_splits_for_queue(q) for q in sorted_queues] + [_select_splits_for_queue(q) for q in sorted_queues] # decides which split to run considering the 'on-the-fly' availability