summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorChongyi Zheng <harryzheng25@gmail.com>2022-07-08 15:45:12 -0400
committerGitHub <noreply@github.com>2022-07-08 20:45:12 +0100
commit49f9d43afefd446287b1b2475d7127d405b7a873 (patch)
tree70f659343c5ed2ce174cb2a5aacb6a66a5084c23 /routers/api/v1
parent496b8e39900842c8253250d3eaddf587be35dfa3 (diff)
downloadgitea-49f9d43afefd446287b1b2475d7127d405b7a873.tar.gz
gitea-49f9d43afefd446287b1b2475d7127d405b7a873.zip
Implement sync push mirror on commit (#19411)
Support synchronizing with the push mirrors whenever new commits are pushed or synced from pull mirror. Related Issues: #18220 Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/repo/mirror.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/repo/mirror.go b/routers/api/v1/repo/mirror.go
index 1af63c55be..3d29383550 100644
--- a/routers/api/v1/repo/mirror.go
+++ b/routers/api/v1/repo/mirror.go
@@ -11,8 +11,8 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/context"
+ mirror_module "code.gitea.io/gitea/modules/mirror"
"code.gitea.io/gitea/modules/setting"
- mirror_service "code.gitea.io/gitea/services/mirror"
)
// MirrorSync adds a mirrored repository to the sync queue
@@ -59,7 +59,7 @@ func MirrorSync(ctx *context.APIContext) {
return
}
- mirror_service.StartToMirror(repo.ID)
+ mirror_module.AddPullMirrorToQueue(repo.ID)
ctx.Status(http.StatusOK)
}