mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-25 21:09:44 +09:00
fix(migrations): cancel GitLab version probes (#39023)
Bind the GitLab version probe to the migration context so a cancelled migration does not remain blocked on a remote response.
This commit is contained in:
@@ -105,7 +105,7 @@ func NewGitlabDownloader(ctx context.Context, baseURL, repoPath, token string) (
|
||||
var resp *gitlab.Response
|
||||
u, _ := url.Parse(baseURL)
|
||||
for len(pathParts) >= 2 {
|
||||
_, resp, err = gitlabClient.Version.GetVersion()
|
||||
_, resp, err = gitlabClient.Version.GetVersion(gitlab.WithContext(ctx))
|
||||
if err == nil || resp != nil && resp.StatusCode == http.StatusUnauthorized {
|
||||
err = nil // if no authentication given, this still should work
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user