Implement Redis caching for S3 list object calls

This commit is contained in:
2024-09-23 10:25:10 +07:00
parent 5656c5a616
commit 9452d48bbd
14 changed files with 279 additions and 241 deletions

View File

@ -16,7 +16,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
return
}
file, err := app.Server.Service.GetFile(fileID)
file, err := app.Server.Service.GetFile(r.Context(), fileID)
if err != nil {
app.Server.Logger.Error("error getting upload info: " + err.Error())
w.WriteHeader(http.StatusInternalServerError)
@ -52,7 +52,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
app.Server.Logger.Error("error copying byte to file dst: " + err.Error())
return
}
app.Server.Service.UpdateFileChunk(r.Context(), file.ID, file.OwnerID, rawIndex, file.TotalChunk)
w.WriteHeader(http.StatusAccepted)
return
}