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>
This commit is contained in:
parent
496b8e3990
commit
49f9d43afe
12 changed files with 208 additions and 98 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue