summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-21 04:01:19 +0800
committerzeripath <art27@cantab.net>2020-01-20 20:01:19 +0000
commitd92781bf941972761177ac9e07441f8893758fd3 (patch)
treed5d00f8f42fc75ee497bfd8cd52d3b431f1d9b67 /cmd
parent27c6b8fc07eab2dd579b94cd92136738ace61706 (diff)
downloadgitea-d92781bf941972761177ac9e07441f8893758fd3.tar.gz
gitea-d92781bf941972761177ac9e07441f8893758fd3.zip
Refactor repository check and sync functions (#9854)
Move more general repository functions out of models/repo.go
Diffstat (limited to 'cmd')
-rw-r--r--cmd/admin.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/admin.go b/cmd/admin.go
index 0b9f6eac44..f6f3e22b97 100644
--- a/cmd/admin.go
+++ b/cmd/admin.go
@@ -14,9 +14,10 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/auth/oauth2"
"code.gitea.io/gitea/modules/git"
+ "code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
pwd "code.gitea.io/gitea/modules/password"
- "code.gitea.io/gitea/modules/repository"
+ repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
@@ -375,7 +376,7 @@ func runRepoSyncReleases(c *cli.Context) error {
}
log.Trace(" currentNumReleases is %d, running SyncReleasesWithTags", oldnum)
- if err = repository.SyncReleasesWithTags(repo, gitRepo); err != nil {
+ if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
log.Warn(" SyncReleasesWithTags: %v", err)
gitRepo.Close()
continue
@@ -410,7 +411,7 @@ func runRegenerateHooks(c *cli.Context) error {
if err := initDB(); err != nil {
return err
}
- return models.SyncRepositoryHooks()
+ return repo_module.SyncRepositoryHooks(graceful.GetManager().ShutdownContext())
}
func runRegenerateKeys(c *cli.Context) error {