From 30591cbfe035901b5ff27e7fca9496c62b39ddc9 Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:20:49 +0300 Subject: [PATCH] fix: race --- pkg/file/redundancy/getter/getter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/file/redundancy/getter/getter.go b/pkg/file/redundancy/getter/getter.go index d58535be238..56d0cd028f0 100644 --- a/pkg/file/redundancy/getter/getter.go +++ b/pkg/file/redundancy/getter/getter.go @@ -357,6 +357,8 @@ func (g *decoder) fly(i int) (success bool) { // save iterate over reconstructed shards and puts the corresponding chunks to local storage func (g *decoder) save(ctx context.Context, missing []int) error { + g.mu.Lock() + defer g.mu.Unlock() for _, i := range missing { if err := g.putter.Put(ctx, swarm.NewChunk(g.addrs[i], g.rsbuf[i])); err != nil { return err