aboutsummaryrefslogtreecommitdiff
path: root/go/operation
diff options
context:
space:
mode:
Diffstat (limited to 'go/operation')
-rw-r--r--go/operation/chunked_file.go2
-rw-r--r--go/operation/delete_content.go9
-rw-r--r--go/operation/submit.go5
3 files changed, 10 insertions, 6 deletions
diff --git a/go/operation/chunked_file.go b/go/operation/chunked_file.go
index 70564cbd2..786b8a989 100644
--- a/go/operation/chunked_file.go
+++ b/go/operation/chunked_file.go
@@ -74,7 +74,7 @@ func (cm *ChunkManifest) DeleteChunks(master string) error {
for _, ci := range cm.Chunks {
if e := DeleteFile(master, ci.Fid, ""); e != nil {
deleteError++
- glog.V(0).Infof("Delete %s error: %s, master: %s", ci.Fid, e.Error(), master)
+ glog.V(0).Infof("Delete %s error: %v, master: %s", ci.Fid, e, master)
}
}
if deleteError > 0 {
diff --git a/go/operation/delete_content.go b/go/operation/delete_content.go
index 32ad69b17..c808cc75a 100644
--- a/go/operation/delete_content.go
+++ b/go/operation/delete_content.go
@@ -3,6 +3,7 @@ package operation
import (
"encoding/json"
"errors"
+ "fmt"
"net/url"
"strings"
"sync"
@@ -23,9 +24,13 @@ type DeleteResult struct {
func DeleteFile(master string, fileId string, jwt security.EncodedJwt) error {
fileUrl, err := LookupFileId(master, fileId)
if err != nil {
- return err
+ return fmt.Errorf("Failed to lookup %s:%v", fileId, err)
}
- return util.Delete(fileUrl, jwt)
+ err = util.Delete(fileUrl, jwt)
+ if err != nil {
+ return fmt.Errorf("Failed to delete %s:%v", fileUrl, err)
+ }
+ return nil
}
func ParseFileId(fid string) (vid string, key_cookie string, err error) {
diff --git a/go/operation/submit.go b/go/operation/submit.go
index d996d63f0..18484680a 100644
--- a/go/operation/submit.go
+++ b/go/operation/submit.go
@@ -4,13 +4,12 @@ import (
"bytes"
"io"
"mime"
+ "net/url"
"os"
"path"
"strconv"
"strings"
- "net/url"
-
"github.com/chrislusf/seaweedfs/go/glog"
"github.com/chrislusf/seaweedfs/go/security"
)
@@ -188,7 +187,7 @@ func upload_chunked_file_manifest(fileUrl string, manifest *ChunkManifest, jwt s
glog.V(4).Info("Uploading chunks manifest ", manifest.Name, " to ", fileUrl, "...")
u, _ := url.Parse(fileUrl)
q := u.Query()
- q.Set("cm", "1")
+ q.Set("cm", "true")
u.RawQuery = q.Encode()
_, e = Upload(u.String(), manifest.Name, bufReader, false, "application/json", jwt)
return e