feat: optimize file operation interface (#2757)
* feat: optimize file operation interface * chore: fix typo Co-authored-by: Noah Hsu <i@nn.ci>
This commit is contained in:
@ -46,8 +46,6 @@ func moveFiles(ctx context.Context, src, dst string, overwrite bool) (status int
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
fs.ClearCache(srcDir)
|
||||
fs.ClearCache(dstDir)
|
||||
// TODO if there are no files copy, should return 204
|
||||
return http.StatusCreated, nil
|
||||
}
|
||||
@ -60,7 +58,6 @@ func copyFiles(ctx context.Context, src, dst string, overwrite bool) (status int
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
fs.ClearCache(path.Dir(dst))
|
||||
// TODO if there are no files copy, should return 204
|
||||
return http.StatusCreated, nil
|
||||
}
|
||||
|
@ -337,7 +337,6 @@ func (h *Handler) handlePut(w http.ResponseWriter, r *http.Request) (status int,
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
w.Header().Set("ETag", etag)
|
||||
fs.ClearCache(path.Dir(reqPath))
|
||||
return http.StatusCreated, nil
|
||||
}
|
||||
|
||||
@ -368,7 +367,6 @@ func (h *Handler) handleMkcol(w http.ResponseWriter, r *http.Request) (status in
|
||||
}
|
||||
return http.StatusMethodNotAllowed, err
|
||||
}
|
||||
fs.ClearCache(path.Dir(reqPath))
|
||||
return http.StatusCreated, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user