From b3b7171c8b5a53fa6e60a8571e7b11944d3d26d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=A8?= Date: Wed, 14 Dec 2022 15:23:09 +0800 Subject: [PATCH] testupdate --- utils/updateObs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/updateObs.py b/utils/updateObs.py index 525fbc1..57cfe81 100644 --- a/utils/updateObs.py +++ b/utils/updateObs.py @@ -17,6 +17,8 @@ def AddObs(file_path, status): with lock: if not cfg.flag: addobs(file_path, status) + os.remove(file_path) + else: if status == '02': addobs(file_path, status) @@ -26,14 +28,14 @@ def AddObs(file_path, status): shutil.move(file_path, f_dst) def addobs(file_path, status): #save videos - ti.sleep(3) + ti.sleep(5) videoUuid = os.path.basename(file_path).split('_')[1] json_data = {'videoUuid': videoUuid} for vre in [cfg.VreTest, cfg.VreTest2]: resp = requests.post(url=vre, data=json_data) status = resp.json() if not 'data' in status:#延迟设置 - ti.sleep(5) + ti.sleep(10) resp = requests.post(url=cfg.Vre, data=json_data) status = resp.json() if 'data' in status: @@ -47,7 +49,7 @@ def addobs(file_path, status): #save videos if objectkey.split('.')[-1] in ['avi','mp4']: objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey resp = obsClient.putFile(bucketName, objectkey, file_path) - os.remove(file_path) + #os.remove(file_path) def Addimg(uuid_barcode): time = uuid_barcode.split('-')[0].split('_')[-1]