Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task Router: check for None #7027

Merged
merged 1 commit into from May 5, 2020
Merged

Task Router: check for None #7027

merged 1 commit into from May 5, 2020

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented May 5, 2020

This will return None at the end, I guess that's ok? I think if it returns None the default queue is used, right?

@@ -82,7 +82,7 @@ def route_for_task(self, task, args, kwargs, **__):

# Build time average is high
length_avg = queryset.filter(pk__in=last_builds).aggregate(Avg('length')).get('length__avg')
if length_avg > self.TIME_AVERAGE:
if length_avg and length_avg > self.TIME_AVERAGE:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length_avg can be None if there are not objects.

@stsewd stsewd requested a review from a team May 5, 2020 21:22
@stsewd stsewd merged commit ecd9c5a into master May 5, 2020
@stsewd stsewd deleted the check-for-none branch May 5, 2020 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants