Skip to content

Commit

Permalink
use join errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Mar 30, 2024
1 parent 1eb2a19 commit 0e88fa0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/chunk/dirproc/base.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dirproc

import (
"errors"
"io"
"sync/atomic"

Expand Down Expand Up @@ -35,13 +36,13 @@ func (p *baseproc) Close() error {
if p.closed.Load() {
return nil
}
var errs error
if err := p.Recorder.Close(); err != nil {
p.wc.Close()
return err
errors.Join(errs, err)
}
p.closed.Store(true)
if err := p.wc.Close(); err != nil {
return err
errors.Join(errs, err)
}
return nil
return errs
}

0 comments on commit 0e88fa0

Please sign in to comment.