Skip to content

Commit

Permalink
fix: race
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Feb 26, 2024
1 parent b2b8423 commit 30591cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/file/redundancy/getter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30591cb

Please sign in to comment.