优化task make

This commit is contained in:
algotao
2025-07-25 17:25:17 +08:00
parent a2bf3c853e
commit a78c16d301
9 changed files with 27 additions and 4 deletions

View File

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

View File

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

View File

@@ -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(),