Skip to content

Commit

Permalink
Retries for _query_cvd_version_dns. Fixes #49.
Browse files Browse the repository at this point in the history
  • Loading branch information
backbord authored and micahsnyder committed May 19, 2023
1 parent 8ca1f23 commit ab30b5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cvdupdate/cvdupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,12 @@ def _query_cvd_version_dns(self, db: str) -> int:

if self.dns_version_tokens == []:
# Query DNS if we haven't already
self._query_dns_txt_entry()
for _attempt in range(self.config['max retry']):
if self._query_dns_txt_entry():
break
# Pause before next attempt.
time.sleep(0.1)

if self.dns_version_tokens == []:
# Query failed. Bail out.
return version
Expand Down

0 comments on commit ab30b5f

Please sign in to comment.