|
@@ -156,7 +156,7 @@ func (this *ImageController) Base64Upload() {
|
|
|
}
|
|
|
outFileName = uploadDir + randStr + ".png"
|
|
|
fmt.Println("start convert", time.Now())
|
|
|
- cd := exec.Command("highcharts-export-server", "--infile", saveSvgPath, "--constr", "Chart", "--scale", "2", "--outfile", outFileName)
|
|
|
+ cd := exec.Command("highcharts-export-server", "--infile", saveSvgPath, "--constr", "Chart", "--scale", "2","--workers","10","--workLimit","5", "--outfile", outFileName)
|
|
|
str, err := cd.Output()
|
|
|
fmt.Println(string(str))
|
|
|
if err != nil {
|
|
@@ -164,10 +164,10 @@ func (this *ImageController) Base64Upload() {
|
|
|
return
|
|
|
}
|
|
|
fmt.Println("end convert", time.Now())
|
|
|
- //defer func() {
|
|
|
- // os.Remove(svgPath)
|
|
|
- // os.Remove(outFileName)
|
|
|
- //}()
|
|
|
+ defer func() {
|
|
|
+ os.Remove(saveSvgPath)
|
|
|
+ os.Remove(outFileName)
|
|
|
+ }()
|
|
|
saveToOssPath = uploadDir + time.Now().Format("200601/20060102/")
|
|
|
saveToOssPath += outFileName
|
|
|
//上传到阿里云
|