Skip to content

Commit

Permalink
fix(edsstore): close files after Put and Get (#1994)
Browse files Browse the repository at this point in the history
Self explanatory
  • Loading branch information
distractedm1nd authored Mar 31, 2023
1 parent 39a2163 commit f18b1ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions share/eds/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func (s *Store) Put(ctx context.Context, root share.DataHash, square *rsmt2d.Ext
if err != nil {
return err
}
defer f.Close()

err = WriteEDS(ctx, square, f)
if err != nil {
Expand Down Expand Up @@ -367,6 +368,7 @@ func (s *Store) Get(ctx context.Context, root share.DataHash) (eds *rsmt2d.Exten
if err != nil {
return nil, fmt.Errorf("failed to get CAR file: %w", err)
}
defer f.Close()
eds, err = ReadEDS(ctx, f, root)
if err != nil {
return nil, fmt.Errorf("failed to read EDS from CAR file: %w", err)
Expand Down

0 comments on commit f18b1ab

Please sign in to comment.