internal/pkg: use correct artifact count
All checks were successful
Test / Create distribution (push) Successful in 46s
Test / Sandbox (push) Successful in 2m47s
Test / ShareFS (push) Successful in 4m43s
Test / Sandbox (race detector) (push) Successful in 5m15s
Test / Hpkg (push) Successful in 5m26s
Test / Hakurei (push) Successful in 5m32s
Test / Hakurei (race detector) (push) Successful in 7m36s
Test / Flake checks (push) Successful in 1m42s
All checks were successful
Test / Create distribution (push) Successful in 46s
Test / Sandbox (push) Successful in 2m47s
Test / ShareFS (push) Successful in 4m43s
Test / Sandbox (race detector) (push) Successful in 5m15s
Test / Hpkg (push) Successful in 5m26s
Test / Hakurei (push) Successful in 5m32s
Test / Hakurei (race detector) (push) Successful in 7m36s
Test / Flake checks (push) Successful in 1m42s
This updates buffer sizes and counters to use correct total artifact count. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -224,6 +224,11 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
|
|||||||
paths[i].src = make([]*check.Absolute, len(p.A))
|
paths[i].src = make([]*check.Absolute, len(p.A))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var artifactCount int
|
||||||
|
for _, p := range a.paths {
|
||||||
|
artifactCount += len(p.A)
|
||||||
|
}
|
||||||
|
|
||||||
if len(paths) > 0 {
|
if len(paths) > 0 {
|
||||||
type cureArtifact struct {
|
type cureArtifact struct {
|
||||||
// Index of pending Artifact in paths.
|
// Index of pending Artifact in paths.
|
||||||
@@ -231,7 +236,7 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
|
|||||||
// Pending artifact.
|
// Pending artifact.
|
||||||
a Artifact
|
a Artifact
|
||||||
}
|
}
|
||||||
ac := make(chan cureArtifact, len(paths))
|
ac := make(chan cureArtifact, artifactCount)
|
||||||
for i, p := range a.paths {
|
for i, p := range a.paths {
|
||||||
for j, d := range p.A {
|
for j, d := range p.A {
|
||||||
ac <- cureArtifact{[2]int{i, j}, d}
|
ac <- cureArtifact{[2]int{i, j}, d}
|
||||||
@@ -265,7 +270,7 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var count int
|
var count int
|
||||||
errs := make([]error, 0, len(paths))
|
errs := make([]error, 0, artifactCount)
|
||||||
for cr := range res {
|
for cr := range res {
|
||||||
count++
|
count++
|
||||||
|
|
||||||
@@ -275,7 +280,7 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
|
|||||||
paths[cr.index[0]].src[cr.index[1]] = cr.pathname
|
paths[cr.index[0]].src[cr.index[1]] = cr.pathname
|
||||||
}
|
}
|
||||||
|
|
||||||
if count == len(paths) {
|
if count == artifactCount {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user