format changes

This commit is contained in:
chrislusf
2015-12-14 22:38:58 -08:00
parent df5e54e02a
commit e921cb1a9d
9 changed files with 30 additions and 34 deletions

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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