Skip to content

Commit

Permalink
fix: img pool
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed May 4, 2024
1 parent f4f0039 commit b7df371
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions img/pool/img.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ func GetImage(name string) (m *Image, err error) {
}
}
resp, err = http2.Get(m.String())
_ = resp.Body.Close()
if err == nil && resp.StatusCode == http.StatusOK {
return
if err == nil {
_ = resp.Body.Close()
if resp.StatusCode == http.StatusOK {
return
}
}
err = ErrImgFileOutdated
return
Expand All @@ -82,9 +84,11 @@ func NewImage(send ctxext.NoCtxSendMsg, get ctxext.NoCtxGetMsg, name, f string)
}
if resp.StatusCode != http.StatusNotFound {
resp, err = http2.Get(m.String())
_ = resp.Body.Close()
if err == nil && resp.StatusCode == http.StatusOK {
return
if err == nil {
_ = resp.Body.Close()
if resp.StatusCode == http.StatusOK {
return
}
}
}
}
Expand Down

0 comments on commit b7df371

Please sign in to comment.