testupdate

This commit is contained in:
2022-12-14 15:23:09 +08:00
parent 0f3433ece9
commit b3b7171c8b

View File

@ -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]