mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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
This commit is contained in:
		@@ -25,6 +25,7 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/modules/validation"
 | 
			
		||||
	"code.gitea.io/gitea/routers/utils"
 | 
			
		||||
	"code.gitea.io/gitea/services/mailer"
 | 
			
		||||
	mirror_service "code.gitea.io/gitea/services/mirror"
 | 
			
		||||
 | 
			
		||||
	"github.com/unknwon/com"
 | 
			
		||||
	"mvdan.cc/xurls/v2"
 | 
			
		||||
@@ -190,7 +191,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
 | 
			
		||||
 | 
			
		||||
		address = u.String()
 | 
			
		||||
 | 
			
		||||
		if err := ctx.Repo.Mirror.SaveAddress(address); err != nil {
 | 
			
		||||
		if err := mirror_service.SaveAddress(ctx.Repo.Mirror, address); err != nil {
 | 
			
		||||
			ctx.ServerError("SaveAddress", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
@@ -204,7 +205,8 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		go models.MirrorQueue.Add(repo.ID)
 | 
			
		||||
		mirror_service.StartToMirror(repo.ID)
 | 
			
		||||
 | 
			
		||||
		ctx.Flash.Info(ctx.Tr("repo.settings.mirror_sync_in_progress"))
 | 
			
		||||
		ctx.Redirect(repo.Link() + "/settings")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user