Compare commits
No commits in common. "4d7668c9ff97b5d4fd7c563dfa1ef137f63a7088" and "c08b4bf90dea966b6cabf0c25e55453eaac2e4b3" have entirely different histories.
4d7668c9ff
...
c08b4bf90d
@ -260,7 +260,7 @@ func (f *Fetcher) fetchChunk(index int) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var buf = make([]byte, 64*1024) // 64KB
|
var buf = make([]byte, 8192)
|
||||||
|
|
||||||
// 重试10次
|
// 重试10次
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/spf13/cast"
|
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
@ -44,7 +43,7 @@ func ByteFmt(size int64) string {
|
|||||||
if frac > 0 {
|
if frac > 0 {
|
||||||
return fmt.Sprintf("%.1f%s", math.Floor(val*10)/10, unitArr[p])
|
return fmt.Sprintf("%.1f%s", math.Floor(val*10)/10, unitArr[p])
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("%d%s", cast.ToInt(val), unitArr[p])
|
return fmt.Sprintf("%d%s", int(val), unitArr[p])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user