diff options
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r-- | routers/api/v1/repo/repo.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 99ae391d..326ff25e 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -359,3 +359,16 @@ func ListForks(ctx *context.APIContext) { ctx.JSON(200, &apiForks) } + +func MirrorSync(ctx *context.APIContext) { + _, repo := parseOwnerAndRepo(ctx) + if ctx.Written() { + return + } else if !repo.IsMirror { + ctx.Status(404) + return + } + + go models.MirrorQueue.Add(repo.ID) + ctx.Status(202) +} |