优化ucloud的日志及重试机制

This commit is contained in:
2024-07-22 17:31:32 +08:00
parent c06796d0a3
commit ee86bb4e74
10 changed files with 124 additions and 86 deletions

View File

@@ -1,7 +1,6 @@
import datetime
import json
import os
import sys
from decimal import Decimal
from io import BytesIO
from itertools import groupby
@@ -9,10 +8,9 @@ from itertools import groupby
import requests
from PIL import ImageDraw, Image, ImageFont
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from db import MysqlSession
from db.mysql import ZxIeCost, ZxIeDischarge, ZxIeSettlement, ZxPhhd, ZxOcr, ZxPhrec
from ucloud import ucloud
from ucloud import ufile
def check_ie_result(pk_phhd):
@@ -78,7 +76,7 @@ def check_ie_result(pk_phhd):
ZxPhrec.pk_phhd == pk_phhd).all()
for phrec in phrecs:
img_name = phrec.cfjaddress
img_path = ucloud.get_private_url(img_name)
img_path = ufile.get_private_url(img_name)
response = requests.get(img_path)
image = Image.open(BytesIO(response.content)).convert("RGB")