Skip to content

Commit

Permalink
sector import: Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Sep 9, 2022
1 parent a0fa5ab commit d4c2d14
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 5 deletions.
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/gateway.json.gz
Binary file not shown.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
Binary file modified build/openrpc/worker.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion itests/sector_import_full_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func TestSectorImport(t *testing.T) {
return
}

remoteCommit1(s)(w, r)
testRemoteCommit1(s, m)(w, r)
}
}
})))
Expand Down
2 changes: 1 addition & 1 deletion storage/pipeline/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ func maybeNotifyRemoteDone(success bool, state string) func(*SectorInfo) {
return
}

defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck

if resp.StatusCode != http.StatusOK {
log.Errorf("remote done notification received non-200 http response %s", resp.Status)
Expand Down
4 changes: 2 additions & 2 deletions storage/pipeline/states_sealing.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ func (m *Sealing) handleCommitting(ctx statemachine.Context, sector SectorInfo)
return ctx.Send(SectorRemoteCommit1Failed{xerrors.Errorf("requesting remote commit1: %w", err)})
}

defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck

if resp.StatusCode != http.StatusOK {
return ctx.Send(SectorRemoteCommit1Failed{xerrors.Errorf("remote commit1 received non-200 http response %s", resp.Status)})
Expand Down Expand Up @@ -648,7 +648,7 @@ func (m *Sealing) handleCommitting(ctx statemachine.Context, sector SectorInfo)
return ctx.Send(SectorRemoteCommit2Failed{xerrors.Errorf("requesting remote commit2: %w", err)})
}

defer resp.Body.Close()
defer resp.Body.Close() //nolint:errcheck

if resp.StatusCode != http.StatusOK {
return ctx.Send(SectorRemoteCommit2Failed{xerrors.Errorf("remote commit2 received non-200 http response %s", resp.Status)})
Expand Down
4 changes: 3 additions & 1 deletion storage/sealer/tarutil/systar.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ func ExtractTar(body io.Reader, dir string, buf []byte) (int64, error) {
return read, xerrors.Errorf("tar file %#v is bigger than expected: %d > %d", header.Name, header.Size, sz)
}

r, err := io.CopyBuffer(f, tr, buf)
ltr := io.LimitReader(tr, header.Size)

r, err := io.CopyBuffer(f, ltr, buf)
read += r
if err != nil {
return read, err
Expand Down

0 comments on commit d4c2d14

Please sign in to comment.