Commit cbf02045 authored by Vadim Bendebury's avatar Vadim Bendebury Committed by Commit Bot

do not try collecting issues information for an empty issues list

There is no point in trying to retrieve issues information when the
issues list is empty, On top of that the attempt to start a thread
pool with zero threads generates an exception.

TEST=running my_activity.py when the user does not have issues on
     certain servers does not cause the exception any more.
Signed-off-by: 's avatarVadim Bendebury <vbendeb@chromium.org>
Change-Id: Ib5889a4c3390a01860fb31a4ff1a343e05b24051
Reviewed-on: https://chromium-review.googlesource.com/1058679Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
parent babd098f
......@@ -695,6 +695,9 @@ class MyActivity(object):
self.monorail_issue_search, monorail_projects.keys())
monorail_issues = list(itertools.chain.from_iterable(monorail_issues))
if not monorail_issues:
return
with contextlib.closing(ThreadPool(len(monorail_issues))) as pool:
filtered_issues = pool.map(
self.filter_modified_monorail_issue, monorail_issues)
......
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 to comment