From 7ff783b7320bdeda89ed6a021c304e64f9d9170e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 1 Oct 2019 21:40:17 +0800 Subject: Move mirror to a standalone package from models (#7486) * move mirror to a standalone package * fix mirror address in template * fix tests * fix lint * fix comment * fix tests * fix tests * fix vendor * fix fmt * fix lint * remove wrong file submitted * fix conflict * remove unrelated changes * fix go mod * fix tests * clean go mod * make vendor work * make vendor work * fix tests * remove duplicated test --- routers/api/v1/repo/repo.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'routers/api') diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index c838ba7271..513e7a37b3 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -20,6 +20,7 @@ import ( api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/api/v1/convert" + mirror_service "code.gitea.io/gitea/services/mirror" ) var searchOrderByMap = map[string]map[string]models.SearchOrderBy{ @@ -869,6 +870,7 @@ func MirrorSync(ctx *context.APIContext) { ctx.Error(403, "MirrorSync", "Must have write access") } - go models.MirrorQueue.Add(repo.ID) + mirror_service.StartToMirror(repo.ID) + ctx.Status(200) } -- cgit v1.2.3