mirror of
https://github.com/aclist/dztui.git
synced 2026-10-31 15:12:48 +01:00
fix: handle remote repo timeout
This commit is contained in:
1 parent
a5140d7761
commit
2184622918
1 file changed
+8
-4
@@ -13,10 +13,14 @@ from dzgui.init.prefix import is_prefix_writeable
|
|||||||
def get_latest_release() -> str | None:
|
def get_latest_release() -> str | None:
|
||||||
tag = None
|
tag = None
|
||||||
for url in [GITHUB_RELEASES, CODEBERG_RELEASES]:
|
for url in [GITHUB_RELEASES, CODEBERG_RELEASES]:
|
||||||
res = requests.get(url, timeout=REQUEST_TIMEOUT)
|
try:
|
||||||
if res.status_code == 200:
|
res = requests.get(url, timeout=REQUEST_TIMEOUT)
|
||||||
tag = res.json()["tag_name"]
|
if res.status_code == 200:
|
||||||
break
|
tag = res.json()["tag_name"]
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
# TODO: log exception
|
||||||
|
continue
|
||||||
return tag
|
return tag
|
||||||
|
|
||||||
def allow_updates(allow: bool) -> bool:
|
def allow_updates(allow: bool) -> bool:
|
||||||
|
|||||||
Reference in new issue
Block a user