diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/init.go | 2 | ||||
-rw-r--r-- | routers/web/repo/repo.go | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/routers/init.go b/routers/init.go index 4cce7992db..2143ab476b 100644 --- a/routers/init.go +++ b/routers/init.go @@ -35,7 +35,6 @@ import ( "code.gitea.io/gitea/routers/common" "code.gitea.io/gitea/routers/private" web_routers "code.gitea.io/gitea/routers/web" - "code.gitea.io/gitea/services/archiver" "code.gitea.io/gitea/services/auth" "code.gitea.io/gitea/services/auth/source/oauth2" "code.gitea.io/gitea/services/cron" @@ -44,6 +43,7 @@ import ( mirror_service "code.gitea.io/gitea/services/mirror" pull_service "code.gitea.io/gitea/services/pull" repo_service "code.gitea.io/gitea/services/repository" + "code.gitea.io/gitea/services/repository/archiver" "code.gitea.io/gitea/services/task" "code.gitea.io/gitea/services/webhook" diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go index bacfa549b5..69bd1ed416 100644 --- a/routers/web/repo/repo.go +++ b/routers/web/repo/repo.go @@ -24,9 +24,9 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/storage" "code.gitea.io/gitea/modules/web" - archiver_service "code.gitea.io/gitea/services/archiver" "code.gitea.io/gitea/services/forms" repo_service "code.gitea.io/gitea/services/repository" + archiver_service "code.gitea.io/gitea/services/repository/archiver" ) const ( @@ -387,12 +387,12 @@ func Download(ctx *context.Context) { return } - archiver, err := models.GetRepoArchiver(db.DefaultContext, aReq.RepoID, aReq.Type, aReq.CommitID) + archiver, err := repo_model.GetRepoArchiver(db.DefaultContext, aReq.RepoID, aReq.Type, aReq.CommitID) if err != nil { ctx.ServerError("models.GetRepoArchiver", err) return } - if archiver != nil && archiver.Status == models.RepoArchiverReady { + if archiver != nil && archiver.Status == repo_model.ArchiverReady { download(ctx, aReq.GetArchiveName(), archiver) return } @@ -417,12 +417,12 @@ func Download(ctx *context.Context) { return } times++ - archiver, err = models.GetRepoArchiver(db.DefaultContext, aReq.RepoID, aReq.Type, aReq.CommitID) + archiver, err = repo_model.GetRepoArchiver(db.DefaultContext, aReq.RepoID, aReq.Type, aReq.CommitID) if err != nil { ctx.ServerError("archiver_service.StartArchive", err) return } - if archiver != nil && archiver.Status == models.RepoArchiverReady { + if archiver != nil && archiver.Status == repo_model.ArchiverReady { download(ctx, aReq.GetArchiveName(), archiver) return } @@ -430,7 +430,7 @@ func Download(ctx *context.Context) { } } -func download(ctx *context.Context, archiveName string, archiver *models.RepoArchiver) { +func download(ctx *context.Context, archiveName string, archiver *repo_model.RepoArchiver) { downloadName := ctx.Repo.Repository.Name + "-" + archiveName rPath, err := archiver.RelativePath() @@ -473,12 +473,12 @@ func InitiateDownload(ctx *context.Context) { return } - archiver, err := models.GetRepoArchiver(db.DefaultContext, aReq.RepoID, aReq.Type, aReq.CommitID) + archiver, err := repo_model.GetRepoArchiver(db.DefaultContext, aReq.RepoID, aReq.Type, aReq.CommitID) if err != nil { ctx.ServerError("archiver_service.StartArchive", err) return } - if archiver == nil || archiver.Status != models.RepoArchiverReady { + if archiver == nil || archiver.Status != repo_model.ArchiverReady { if err := archiver_service.StartArchive(aReq); err != nil { ctx.ServerError("archiver_service.StartArchive", err) return @@ -486,7 +486,7 @@ func InitiateDownload(ctx *context.Context) { } var completed bool - if archiver != nil && archiver.Status == models.RepoArchiverReady { + if archiver != nil && archiver.Status == repo_model.ArchiverReady { completed = true } |