mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 21:52:01 +08:00
Use goroutine for prefetch (#12)
This commit is contained in:
parent
73884394d9
commit
c45af53b26
@ -229,7 +229,7 @@ func prefetchImages(confImgPath string, QUALITY string) {
|
|||||||
_, p2 := genWebpAbs(picAbsPath, info.Name(), proposedURI)
|
_, p2 := genWebpAbs(picAbsPath, info.Name(), proposedURI)
|
||||||
q, _ := strconv.ParseFloat(QUALITY, 32)
|
q, _ := strconv.ParseFloat(QUALITY, 32)
|
||||||
_ = os.MkdirAll(path.Dir(p2), os.ModePerm)
|
_ = os.MkdirAll(path.Dir(p2), os.ModePerm)
|
||||||
_ = webpEncoder(picAbsPath, p2, float32(q), false)
|
go webpEncoder(picAbsPath, p2, float32(q), false)
|
||||||
count += 1
|
count += 1
|
||||||
// progress bar
|
// progress bar
|
||||||
_, _ = fmt.Fprintf(os.Stdout, "Convert in progress: %d/%d\r", count, all)
|
_, _ = fmt.Fprintf(os.Stdout, "Convert in progress: %d/%d\r", count, all)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user