refactor: update putfile and gethash call names
This commit is contained in:
parent
6acf8a606a
commit
2c30477465
|
@ -138,7 +138,7 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
|
||||||
}(r.Body)
|
}(r.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
hash, err := h.portal.Storage().GetHash(rs)
|
hash, err := h.portal.Storage().GetHashSmall(rs)
|
||||||
_, err = rs.Seek(0, io.SeekStart)
|
_, err = rs.Seek(0, io.SeekStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
||||||
|
@ -173,7 +173,7 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hash, err = h.portal.Storage().PutFile(rs, "s5", false)
|
hash, err = h.portal.Storage().PutFileSmall(rs, "s5", false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
||||||
|
@ -758,7 +758,7 @@ func (h *HttpHandler) DirectoryUpload(jc jape.Context) {
|
||||||
|
|
||||||
var rs io.ReadSeeker
|
var rs io.ReadSeeker
|
||||||
|
|
||||||
hash, err := h.portal.Storage().GetHash(rs)
|
hash, err := h.portal.Storage().GetHashSmall(rs)
|
||||||
_, err = rs.Seek(0, io.SeekStart)
|
_, err = rs.Seek(0, io.SeekStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
||||||
|
@ -771,7 +771,7 @@ func (h *HttpHandler) DirectoryUpload(jc jape.Context) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
hash, err = h.portal.Storage().PutFile(rs, "s5", false)
|
hash, err = h.portal.Storage().PutFileSmall(rs, "s5", false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errored(err)
|
errored(err)
|
||||||
|
@ -839,7 +839,7 @@ func (h *HttpHandler) DirectoryUpload(jc jape.Context) {
|
||||||
|
|
||||||
var rs = bytes.NewReader(appData)
|
var rs = bytes.NewReader(appData)
|
||||||
|
|
||||||
hash, err := h.portal.Storage().GetHash(rs)
|
hash, err := h.portal.Storage().GetHashSmall(rs)
|
||||||
_, err = rs.Seek(0, io.SeekStart)
|
_, err = rs.Seek(0, io.SeekStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)
|
||||||
|
@ -864,7 +864,7 @@ func (h *HttpHandler) DirectoryUpload(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hash, err = h.portal.Storage().PutFile(rs, "s5", false)
|
hash, err = h.portal.Storage().PutFileSmall(rs, "s5", false)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errored(err)
|
errored(err)
|
||||||
|
|
Loading…
Reference in New Issue