diff --git a/utils/.config.py.swp b/utils/.config.py.swp deleted file mode 100644 index f58c9b2..0000000 Binary files a/utils/.config.py.swp and /dev/null differ diff --git a/utils/updateObs.py b/utils/updateObs.py index 2af3bd9..7014060 100644 --- a/utils/updateObs.py +++ b/utils/updateObs.py @@ -26,22 +26,23 @@ def AddObs(file_path, status): shutil.move(file_path, f_dst) def addobs(file_path, status): #save videos - ti.sleep(2) + ti.sleep(3) + num = 0 videoUuid = os.path.basename(file_path).split('_')[1] json_data = {'videoUuid': videoUuid} resp = requests.post(url=cfg.Vre, data=json_data) - #print('>>>>>>>>>',resp) status = resp.json() - #print('>>>>>>>>>>>>>', json_data) - #print('>>>>>>>>>>>>>', status) - try: - status = status['data'] - except Exception as e: - ti.sleep(5) - resp = requests.post(url=cfg.Vre,data=json_data) - status = resp.json() - status = status['data'] + if not 'data' in status:#延迟设置 + while num < 20: + ti.sleep(2) + num += 1 + resp = requests.post(url=cfg.Vre, data=json_data) + status = resp.json() + if not 'data' in status: + continue + else:break + status = status['data'] objectkey = os.path.basename(file_path) time = os.path.basename(file_path).split('-')[0]