This commit is contained in:
2023-01-28 13:34:35 +08:00
parent 52c6ecda01
commit ffe2ad0e1c
2 changed files with 37 additions and 4 deletions

View File

@ -27,7 +27,8 @@ def AddObs(file_path, status):
shutil.move(file_path, f_dst)
def addobs(file_path, status): #save videos
ti.sleep(3)
T1 = ti.time()
ti.sleep(1)
num = 0
videoUuid = os.path.basename(file_path).split('_')[1]
json_data = {'videoUuid': videoUuid}
@ -35,14 +36,16 @@ def addobs(file_path, status): #save videos
data=json_data)
status = resp.json()
if not 'data' in status:#延迟设置
while num < 20:
ti.sleep(2)
for _ in range(20):
ti.sleep(1)
num += 1
resp = requests.post(url=cfg.Vre, data=json_data)
status = resp.json()
if not 'data' in status:
continue
else:break
T2 = ti.time()
print('videoUuid>>>{} get_status_time>>>{}'.format((videoUuid), (T2-T1)))
status = status['data']
objectkey = os.path.basename(file_path)
@ -72,7 +75,6 @@ def updateAgain():
except Exception as e:
pass
def Addimg(uuid_barcode):
time = uuid_barcode.split('-')[0].split('_')[-1]
objectkey = 'imgs/'+time+'/'+uuid_barcode+'.jpg'