Skip to content

Commit

Permalink
Catch timeout error while updating appliance files
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Dec 27, 2022
1 parent 25e665f commit 59a89cc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions gns3/appliance_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .controller import Controller
from .local_config import LocalConfig
from .settings import GENERAL_SETTINGS
from .http_client_error import HttpClientError


import logging
Expand Down Expand Up @@ -49,12 +50,17 @@ def refresh(self, update=False):
settings = LocalConfig.instance().loadSectionSettings("MainWindow", GENERAL_SETTINGS)
symbol_theme = settings["symbol_theme"]
if update is True:
self._controller.get(
"/appliances?update=yes&symbol_theme={}".format(symbol_theme),
self._listAppliancesCallback,
progress_text="Downloading appliances from online registry...",
wait=True
)
try:
self._controller.get(
"/appliances?update=yes&symbol_theme={}".format(symbol_theme),
self._listAppliancesCallback,
progress_text="Downloading appliances from online registry...",
wait=True,
timeout=300
)
except HttpClientError as e:
log.error(f"Error while getting appliances list: {e}")
return
else:
self._controller.get("/appliances?symbol_theme={}".format(symbol_theme), self._listAppliancesCallback)

Expand Down

0 comments on commit 59a89cc

Please sign in to comment.