edgeUpdate

This commit is contained in:
2023-01-17 15:29:19 +08:00
parent 931445efdd
commit 961eabd344

View File

@ -27,14 +27,14 @@ def AddObs(file_path, status):
shutil.move(file_path, f_dst)
def addobs(file_path, status): #save videos
ti.sleep(1)
ti.sleep(0.5)
videoUuid = os.path.basename(file_path).split('_')[1]
json_data = {'videoUuid': videoUuid}
for vre in [cfg.VreTest, cfg.VreTest2, cfg.Vre]:
resp = requests.post(url=vre, data=json_data)
status = resp.json()
if not 'data' in status:#延迟设置
ti.sleep(1)
ti.sleep(0.5)
resp = requests.post(url=vre, data=json_data)
status = resp.json()
if 'data' in status:
@ -42,18 +42,18 @@ def addobs(file_path, status): #save videos
else:
break
if not 'data' in status:
os.remove(file_path)
# os.remove(file_path)
return 'can not get the status'
status = status['data']
objectkey = os.path.basename(file_path)
status_ = get_weightStatus(objectkey)
backups_path = os.sep.join([cfg.backups, status+'_'+objectkey])
# backups_path = os.sep.join([cfg.backups, status+'_'+objectkey])
time = os.path.basename(file_path).split('-')[0]
if objectkey.split('.')[-1] in ['avi','mp4']:
objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey
if status == '02' or status_:
resp = obsClient.putFile(bucketName, objectkey, file_path)
shutil.move(file_path, backups_path)
# shutil.move(file_path, backups_path)
#os.remove(file_path)
def Addimg(uuid_barcode):