aboutsummaryrefslogtreecommitdiff
path: root/go/operation/delete_content.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2015-12-14 21:42:38 -0800
committerChris Lu <chris.lu@gmail.com>2015-12-14 21:42:38 -0800
commitdf5e54e02af60f6a1537cd5853def4dad42932bc (patch)
tree1037c5cff81bfda50ca42a3249ebaeeb3774501e /go/operation/delete_content.go
parent020dd480ed8dab0eeb3b6b25b2558084a51b26f2 (diff)
parent031d26527f0ebe39bb26c8e8b4503168a849265a (diff)
downloadseaweedfs-df5e54e02af60f6a1537cd5853def4dad42932bc.tar.xz
seaweedfs-df5e54e02af60f6a1537cd5853def4dad42932bc.zip
Merge pull request #224 from tnextday/feature/chunked-file-support
Feature/chunked file support
Diffstat (limited to 'go/operation/delete_content.go')
-rw-r--r--go/operation/delete_content.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/go/operation/delete_content.go b/go/operation/delete_content.go
index ac3dfa6b2..32ad69b17 100644
--- a/go/operation/delete_content.go
+++ b/go/operation/delete_content.go
@@ -7,14 +7,17 @@ import (
"strings"
"sync"
+ "net/http"
+
"github.com/chrislusf/seaweedfs/go/security"
"github.com/chrislusf/seaweedfs/go/util"
)
type DeleteResult struct {
- Fid string `json:"fid"`
- Size int `json:"size"`
- Error string `json:"error,omitempty"`
+ Fid string `json:"fid"`
+ Size int `json:"size"`
+ Status int `json:"status"`
+ Error string `json:"error,omitempty"`
}
func DeleteFile(master string, fileId string, jwt security.EncodedJwt) error {
@@ -45,7 +48,11 @@ func DeleteFiles(master string, fileIds []string) (*DeleteFilesResult, error) {
for _, fileId := range fileIds {
vid, _, err := ParseFileId(fileId)
if err != nil {
- ret.Results = append(ret.Results, DeleteResult{Fid: vid, Error: err.Error()})
+ ret.Results = append(ret.Results, DeleteResult{
+ Fid: vid,
+ Status: http.StatusBadRequest,
+ Error: err.Error()},
+ )
continue
}
if _, ok := vid_to_fileIds[vid]; !ok {
@@ -76,6 +83,7 @@ func DeleteFiles(master string, fileIds []string) (*DeleteFilesResult, error) {
}
var wg sync.WaitGroup
+
for server, fidList := range server_to_fileIds {
wg.Add(1)
go func(server string, fidList []string) {