fix(release): retry FRP tunnel reconnection responses
Gitea CI / Check code and tests (pull_request) Successful in 5m11s
Gitea CI / Build Android APK (pull_request) Failing after 4m12s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 5m11s
Gitea CI / Check code and tests (pull_request) Successful in 5m11s
Gitea CI / Build Android APK (pull_request) Failing after 4m12s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 5m11s
This commit is contained in:
1 parent
2497865d0e
commit
933ace4e51
3 files changed
+34
No files matched your search
@@ -17,6 +17,11 @@ RETRY_DELAYS = (5, 15)
|
||||
|
||||
def transient(error):
|
||||
if isinstance(error, urllib.error.HTTPError):
|
||||
if error.code == 404 and error.headers.get('Content-Type', '').split(';')[0].lower() == 'text/html':
|
||||
body = error.read(64 * 1024).lower()
|
||||
# FRP returns this page while the vhost tunnel is unavailable.
|
||||
# A normal Gitea API 404 remains a permanent error.
|
||||
return b'github.com/fatedier/frp' in body and b'not found' in body
|
||||
return error.code in {408, 429, 500, 502, 503, 504}
|
||||
return isinstance(error, (urllib.error.URLError, TimeoutError, ConnectionError,
|
||||
http.client.IncompleteRead))
|
||||
|
||||
Reference in new issue
Block a user