mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-24 02:13:35 +08:00
deletion add option skipChunkDeletion
This commit is contained in:
@@ -280,14 +280,14 @@ func (fs *FilerServer) uploadToVolumeServer(r *http.Request, u *url.URL, auth se
|
|||||||
// curl -X DELETE http://localhost:8888/path/to
|
// curl -X DELETE http://localhost:8888/path/to
|
||||||
// curl -X DELETE http://localhost:8888/path/to?recursive=true
|
// curl -X DELETE http://localhost:8888/path/to?recursive=true
|
||||||
// curl -X DELETE http://localhost:8888/path/to?recursive=true&ignoreRecursiveError=true
|
// curl -X DELETE http://localhost:8888/path/to?recursive=true&ignoreRecursiveError=true
|
||||||
// curl -X DELETE http://localhost:8888/path/to?recursive=true&shouldDeleteChunks=true
|
// curl -X DELETE http://localhost:8888/path/to?recursive=true&skipChunkDeletion=true
|
||||||
func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
isRecursive := r.FormValue("recursive") == "true"
|
isRecursive := r.FormValue("recursive") == "true"
|
||||||
ignoreRecursiveError := r.FormValue("ignoreRecursiveError") == "true"
|
ignoreRecursiveError := r.FormValue("ignoreRecursiveError") == "true"
|
||||||
shouldDeleteChunks := r.FormValue("shouldDeleteChunks") == "true"
|
skipChunkDeletion := r.FormValue("skipChunkDeletion") == "true"
|
||||||
|
|
||||||
err := fs.filer.DeleteEntryMetaAndData(context.Background(), filer2.FullPath(r.URL.Path), isRecursive, ignoreRecursiveError, shouldDeleteChunks)
|
err := fs.filer.DeleteEntryMetaAndData(context.Background(), filer2.FullPath(r.URL.Path), isRecursive, ignoreRecursiveError, !skipChunkDeletion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
|
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
|
||||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||||
|
Reference in New Issue
Block a user