debug: add logging

This commit is contained in:
Derrick Hammer 2024-01-18 14:28:32 -05:00
parent 8161d36f0e
commit 12de0342f5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -181,6 +181,8 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
return
}
h.portal.Logger().Info("Hash", zap.String("hash", hex.EncodeToString(hash)))
cid, err := encoding.CIDFromHash(hash, uint64(bufferSize), types.CIDTypeRaw, types.HashTypeBlake3)
if err != nil {
@ -197,6 +199,8 @@ func (h *HttpHandler) SmallFileUpload(jc jape.Context) {
return
}
h.portal.Logger().Info("CID", zap.String("cidStr", cidStr))
upload, err := h.portal.Storage().CreateUpload(hash, uint(jc.Request.Context().Value(AuthUserIDKey).(uint64)), jc.Request.RemoteAddr, uint64(bufferSize), "s5")
if err != nil {
_ = jc.Error(errUploadingFileErr, http.StatusInternalServerError)