Skip to content

Commit ecd9c5a

Browse files
authored
Merge pull request #7027 from readthedocs/check-for-none
Task Router: check for None
2 parents 47286d7 + d967ffa commit ecd9c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readthedocs/builds/tasks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def route_for_task(self, task, args, kwargs, **__):
8282

8383
# Build time average is high
8484
length_avg = queryset.filter(pk__in=last_builds).aggregate(Avg('length')).get('length__avg')
85-
if length_avg > self.TIME_AVERAGE:
85+
if length_avg and length_avg > self.TIME_AVERAGE:
8686
log.info(
8787
'Routing task because project has high time average. queue=%s',
8888
self.BUILD_LARGE_QUEUE,

0 commit comments

Comments
 (0)