Call git.InitSimple for runRepoSyncReleases (#26396) (#26450)

Backport #26396 by @wxiaoguang

Fix #26394

Otherwise, the git module is not initialized and it doesn't respect the
"timeout" config in app.ini

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit d6cf261be8)
This commit is contained in:
Giteabot 2023-08-11 07:16:12 +08:00 committed by Earl Warren
parent bbe06fcf17
commit 5cf57d940f
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -348,6 +348,10 @@ func runRepoSyncReleases(_ *cli.Context) error {
return err return err
} }
if err := git.InitSimple(ctx); err != nil {
return err
}
log.Trace("Synchronizing repository releases (this may take a while)") log.Trace("Synchronizing repository releases (this may take a while)")
for page := 1; ; page++ { for page := 1; ; page++ {
repos, count, err := repo_model.SearchRepositoryByName(ctx, &repo_model.SearchRepoOptions{ repos, count, err := repo_model.SearchRepositoryByName(ctx, &repo_model.SearchRepoOptions{