Add caching for user files

This commit is contained in:
2024-09-23 17:24:55 +07:00
parent 1feeafe7de
commit 59d4154ef0
15 changed files with 318 additions and 91 deletions

View File

@ -31,6 +31,13 @@ func DELETE(w http.ResponseWriter, r *http.Request) {
return
}
err = app.Server.Service.RemoveUserFilesCache(r.Context(), userSession.UserID)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
app.Server.Logger.Error(err.Error())
return
}
err = app.Server.Storage.Delete(r.Context(), fmt.Sprintf("%s/%s", file.OwnerID.String(), file.ID.String()))
if err != nil {
w.WriteHeader(http.StatusInternalServerError)