diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index f165246..ce7eda2 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -272,7 +272,22 @@ class BugzillaProxy: # Update only maintained releases bz_query['version'] = self.config["products"][product]["versions"] - query_results = self.server.query(bz_query) + def _query_bz(query, num_attempts=5): + for i in range(num_attempts): + try: + raw_data = self.server.query(bz_query) + break + except Exception as e: + if i >= num_attempts - 1: + raise + if self.config['verbose']: + print(f" ERROR {e}") + print(" - Query failed, going to try again in 20 seconds") + # Wait 20 seconds and try again + time.sleep(20) + return raw_data + + query_results = _query_bz(bz_query) for bug in query_results: if bug.assigned_to == prev_poc and bug.assigned_to != new_poc: