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/