~comcloudway/builds.sr.ht

cac5b10a9e6e4d288de45f0a519534b299f572c5 — Andres Erbsen 5 years ago a9bff71
Cancel guest settling Context to satisfy go vet

According to go vet, this should be done to avoid a context leak.
Tested with the hello world example and the archlinux image.
Now go vet passes inside worker/.
1 files changed, 2 insertions(+), 1 deletions(-)

M worker/tasks.go
M worker/tasks.go => worker/tasks.go +2 -1
@@ 94,7 94,8 @@ func (ctx *JobContext) Settle() error {
	archTimer := prometheus.NewTimer(archSettleTime)
	defer archTimer.ObserveDuration()

	timeout, _ := context.WithTimeout(ctx.Context, 120*time.Second)
	timeout, cancel := context.WithTimeout(ctx.Context, 120*time.Second)
	defer cancel()
	done := make(chan error, 1)
	attempt := 0
	go func() {