Skip to content

Commit

Permalink
core: Handle curl timeout
Browse files Browse the repository at this point in the history
fix #2369
  • Loading branch information
mirkobrombin committed Dec 14, 2022
1 parent 7e10ab0 commit abab25c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bottles/backend/managers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ def __get_index(self):
c.setopt(c.URL, __index)
c.setopt(c.NOBODY, True)
c.setopt(c.FOLLOWLOCATION, True)
c.setopt(c.TIMEOUT, 5)
c.perform()
c.setopt(c.TIMEOUT, 10)
try:
c.perform()
except pycurl.error as e:
logging.error(f"Could not get index for {repo} repository: {e}")
continue

if c.getinfo(c.RESPONSE_CODE) == 200:
data["index"] = __index
Expand Down

0 comments on commit abab25c

Please sign in to comment.