Skip to content

Commit

Permalink
connect to git mirror server only if use gitea
Browse files Browse the repository at this point in the history
  • Loading branch information
Lei Da authored and Rader committed Oct 17, 2024
1 parent f2dafd4 commit fdb7fbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions builder/git/mirrorserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ func NewMirrorServer(config *config.Config) (mirrorserver.MirrorServer, error) {
return mirrorServer, err
}

//TODO: implement gitaly based mirrorserver

return nil, errors.New("undefined mirror server type")
}
12 changes: 7 additions & 5 deletions component/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ type MirrorComponent struct {
func NewMirrorComponent(config *config.Config) (*MirrorComponent, error) {
var err error
c := &MirrorComponent{}
c.mirrorServer, err = git.NewMirrorServer(config)
if err != nil {
newError := fmt.Errorf("fail to create git mirror server,error:%w", err)
slog.Error(newError.Error())
return nil, newError
if config.GitServer.Type == types.GitServerTypeGitea {
c.mirrorServer, err = git.NewMirrorServer(config)
if err != nil {
newError := fmt.Errorf("fail to create git mirror server,error:%w", err)
slog.Error(newError.Error())
return nil, newError
}
}
c.mq, err = queue.GetPriorityQueueInstance()
if err != nil {
Expand Down

0 comments on commit fdb7fbd

Please sign in to comment.