优化task make
This commit is contained in:
@@ -62,7 +62,7 @@ func paramBatchSize(fs *flag.FlagSet) *uint {
|
||||
}
|
||||
|
||||
func paramBlockSize(fs *flag.FlagSet) *string {
|
||||
return fs.String("blocksize", "200M", "Block size to make hash. using size mode K, M, G, T")
|
||||
return fs.String("blocksize", "50M", "Block size to make hash. using size mode K, M, G, T")
|
||||
}
|
||||
|
||||
func paramClear(fs *flag.FlagSet) *bool {
|
||||
|
||||
@@ -104,6 +104,9 @@ func doMakeHash(makeTaskParams *makeTaskParams, firstLevel bool) error {
|
||||
|
||||
if !fsInfo.IsDir() {
|
||||
// 如果是文件,直接计算
|
||||
if firstLevel {
|
||||
makeTaskParams.task.SourcePath = filepath.Dir(makeTaskParams.sourcePath)
|
||||
}
|
||||
err = doTaskMake(makeTaskParams)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -94,7 +94,9 @@ func doTaskUpload(uploadTaskParams uploadTaskParams) error {
|
||||
}
|
||||
|
||||
if blockRes.GetCode() != saasapi.ErrorCode_SUCC {
|
||||
return fmt.Errorf("upload block error, code %d, msg %s", blockRes.GetCode(), blockRes.GetStatus())
|
||||
err = fmt.Errorf("upload block error, code %d, msg %s", blockRes.GetCode(), blockRes.GetStatus())
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
return err
|
||||
} else {
|
||||
fmt.Printf("upload block success. file: %v, sha256 %v. block %v/%v, file %v/%v\n",
|
||||
finfo.GetFileName(), binfo.GetBlockSha256(),
|
||||
|
||||
Reference in New Issue
Block a user