sector import: Fix lint
This commit is contained in:
parent
061a990eb8
commit
fec9c0f981
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -3242,10 +3242,7 @@ Inputs:
|
|||||||
5432
|
5432
|
||||||
],
|
],
|
||||||
"Expiration": 10101,
|
"Expiration": 10101,
|
||||||
"ReplaceCapacity": true,
|
"UnsealedCid": null
|
||||||
"ReplaceSectorDeadline": 42,
|
|
||||||
"ReplaceSectorPartition": 42,
|
|
||||||
"ReplaceSectorNumber": 9
|
|
||||||
},
|
},
|
||||||
"PreCommitDeposit": "0",
|
"PreCommitDeposit": "0",
|
||||||
"PreCommitMessage": null,
|
"PreCommitMessage": null,
|
||||||
|
@ -259,7 +259,7 @@ func TestSectorImport(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteCommit1(s)(w, r)
|
testRemoteCommit1(s, m)(w, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
|
@ -797,7 +797,7 @@ This parameter is ONLY applicable if the retrieval pricing policy strategy has b
|
|||||||
Comment: ``,
|
Comment: ``,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Num: "AllowSectorDownload",
|
Num: "AllowSectorDownload",
|
||||||
Type: "bool",
|
Type: "bool",
|
||||||
|
|
||||||
Comment: ``,
|
Comment: ``,
|
||||||
|
@ -855,7 +855,7 @@ func maybeNotifyRemoteDone(success bool, state string) func(*SectorInfo) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close() //nolint:errcheck
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
log.Errorf("remote done notification received non-200 http response %s", resp.Status)
|
log.Errorf("remote done notification received non-200 http response %s", resp.Status)
|
||||||
|
@ -609,7 +609,7 @@ func (m *Sealing) handleCommitting(ctx statemachine.Context, sector SectorInfo)
|
|||||||
return ctx.Send(SectorRemoteCommit1Failed{xerrors.Errorf("requesting remote commit1: %w", err)})
|
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 {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return ctx.Send(SectorRemoteCommit1Failed{xerrors.Errorf("remote commit1 received non-200 http response %s", resp.Status)})
|
return ctx.Send(SectorRemoteCommit1Failed{xerrors.Errorf("remote commit1 received non-200 http response %s", resp.Status)})
|
||||||
@ -655,7 +655,7 @@ func (m *Sealing) handleCommitting(ctx statemachine.Context, sector SectorInfo)
|
|||||||
return ctx.Send(SectorRemoteCommit2Failed{xerrors.Errorf("requesting remote commit2: %w", err)})
|
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 {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return ctx.Send(SectorRemoteCommit2Failed{xerrors.Errorf("remote commit2 received non-200 http response %s", resp.Status)})
|
return ctx.Send(SectorRemoteCommit2Failed{xerrors.Errorf("remote commit2 received non-200 http response %s", resp.Status)})
|
||||||
|
@ -102,7 +102,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)
|
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
|
read += r
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return read, err
|
return read, err
|
||||||
|
Loading…
Reference in New Issue
Block a user