Skip to content

Commit b28e5e6

Browse files
committed
fix: glitches on big instances destinations
correct an insufficient size channel fetch all projects / groups recursively in destination as well if big instance
1 parent 01b7a61 commit b28e5e6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

internal/mirroring/get_group.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (g *GitlabInstance) fetchAndProcessGroupRecursive(gid any, fetchOriginPath
195195
}
196196
if group != nil {
197197
g.storeGroup(group, fetchOriginPath, mirrorMapping)
198-
if g.isSource() {
198+
if g.isSource() || g.isBig() {
199199
wg.Add(2)
200200
// Fetch the projects of the group
201201
go g.fetchAndProcessGroupProjects(group, fetchOriginPath, mirrorMapping, errChan, wg)
@@ -225,7 +225,7 @@ func (g *GitlabInstance) fetchAndProcessGroupSubgroups(group *gitlab.Group, fetc
225225
}
226226
for _, subgroup := range subgroups {
227227
g.storeGroup(subgroup, fetchOriginPath, mirrorMapping)
228-
if g.isSource() {
228+
if g.isSource() || g.isBig() {
229229
wg.Add(1)
230230
go g.fetchAndProcessGroupRecursive(subgroup, fetchOriginPath, mirrorMapping, errChan, wg)
231231
}

internal/mirroring/put.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ func (destinationGitlabInstance *GitlabInstance) updateProjectFromSource(sourceG
2929
}
3030

3131
wg := sync.WaitGroup{}
32-
maxErrors := 3
33-
wg.Add(maxErrors)
34-
errorChan := make(chan error, maxErrors)
32+
wg.Add(3)
33+
errorChan := make(chan error, 4)
3534

3635
go func(sp *gitlab.Project, dp *gitlab.Project) {
3736
defer wg.Done()

0 commit comments

Comments
 (0)