Browse Source

Merge branch 'aj_convert_to_pdf' into debug

hongze 8 months ago
parent
commit
6ba051e64a
1 changed files with 5 additions and 5 deletions
  1. 5 5
      services/smart_report.go

+ 5 - 5
services/smart_report.go

@@ -156,11 +156,11 @@ async def main():
     })
     await page.goto('%s', {
         'waitUntil': 'networkidle0',
-        'timeout': 1000000  # 设置超时时间为 100
+        'timeout': 3000000  # 设置超时时间为 100
     })
 
     # 在生成PDF之前等待2
-    await asyncio.sleep(5)
+    await asyncio.sleep(10)
 
     await page.pdf({
         'path': "%s",
@@ -229,7 +229,7 @@ async def main():
         # 导航到页面
         await page.goto('%s', {
             'waitUntil': 'networkidle0',
-            'timeout': 1000000  # 设置超时时间为 100
+            'timeout': 3000000  # 设置超时时间为 100
         })
         # Customizing footer for page numbers starting from page 2
 
@@ -239,7 +239,7 @@ async def main():
         await page.screenshot({
             'path': "%s",
             'fullPage': True,
-			'quality':100
+			'quality':80
         })
         
     except errors.BrowserError as e:
@@ -327,7 +327,7 @@ func Report2pdfAndJpeg(reportUrl string, reportId, reportType int) {
 	reportCode := utils.MD5(strconv.Itoa(reportId))
 
 	pdfPath := `./static/` + reportCode + ".pdf"
-	jpegPath := `./static/` + reportCode + ".jpeg"
+	jpegPath := `./static/` + reportCode + ".jpg"
 
 	err = ReportToPdf(reportUrl, pdfPath)
 	if err != nil {