From c1ec0d17285d544f29b244d37acff4aaab3639b4 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 23 Oct 2017 18:38:55 +0000 Subject: [PATCH] Tolerate timeouts when building this cache. --- .../pagure/templates/pagure-sync-bugzilla.py.j2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 b/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 index ca3bfad689..9f84923a9f 100644 --- a/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 +++ b/roles/distgit/pagure/templates/pagure-sync-bugzilla.py.j2 @@ -280,9 +280,15 @@ class Bugzilla(object): base_url=FASURL, username=FASUSER, password=FASPASS) - self.userCache = self.fas.people_by_key( - key='username', - fields=['bugzilla_email']) + + try: + self.userCache = self.fas.people_by_key( + key='username', + fields=['bugzilla_email']) + except fedora.client.ServerError: + # Sometimes, building the userCache up front fails with a timeout. + # It's ok, we build the cache as-needed later in the script. + self.userCache = {} def _get_bugzilla_email(self, username): '''Return the bugzilla email address for a user.