From 0b9b2eb4f0d1786fbfc66ac31323ac6d98f603ec Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Mon, 24 Feb 2025 16:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=BF=9B=E8=A1=8C=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E7=9A=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- no_resize.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/no_resize.py b/no_resize.py index 7640452..eb76ba6 100644 --- a/no_resize.py +++ b/no_resize.py @@ -126,7 +126,24 @@ def down_obj_fromoss(pid, print_type=1, order_id=None,download_flag="print_build -def make3d4print_task(orderId): +def make3d4print_task(r): + try: + if r.llen('model:noresize') == 0: + print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '暂无可处理的数据') + time.sleep(5) + except Exception as e: + time.sleep(5) + print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), 'redis连接异常,重新连接') + r = redis.Redis(host='106.14.158.208', password='kcV2000', port=6379, db=6) + return + orderId = r.lpop('model:noresize') + if orderId is None: return + + if type(orderId) != str: + orderId = orderId.decode('utf-8') + # orderId = 56077 + res = getPidFromOrderId(orderId) + res = getPidFromOrderId(orderId) if res == -1: print("查询打印订单信息失败,重新开启进程") @@ -194,7 +211,6 @@ if __name__ == '__main__': workdir = 'E:\\' else: workdir = '/data/datasets/' - blenderbin = find_blender_bin_path() r = create_redis_connection() #E:\\complate/objs/147852_54579/