|
@@ -19,6 +19,7 @@ url2_private = "http://10.14.86.127:9081/device/data/callback"
|
|
|
|
|
|
error_bag_json = "/mnt/disk001/dcl_data_process/src/python2/pjisuv/callback-errorBag.json"
|
|
error_bag_json = "/mnt/disk001/dcl_data_process/src/python2/pjisuv/callback-errorBag.json"
|
|
|
|
|
|
|
|
+
|
|
def parse_json_to_string_array(file_path):
|
|
def parse_json_to_string_array(file_path):
|
|
try:
|
|
try:
|
|
# 打开并读取JSON文件(Python 2中不支持encoding参数,需要使用codecs模块或处理文件读取后的编码)
|
|
# 打开并读取JSON文件(Python 2中不支持encoding参数,需要使用codecs模块或处理文件读取后的编码)
|
|
@@ -58,6 +59,7 @@ def list_to_json_file(data, file_path):
|
|
# 将UTF-8编码的JSON字符串写入文件
|
|
# 将UTF-8编码的JSON字符串写入文件
|
|
file.write(json_data_utf8)
|
|
file.write(json_data_utf8)
|
|
|
|
|
|
|
|
+
|
|
def add_hour(date_string, hour_number):
|
|
def add_hour(date_string, hour_number):
|
|
original_date = datetime.strptime(date_string, "%Y-%m-%d-%H-%M-%S")
|
|
original_date = datetime.strptime(date_string, "%Y-%m-%d-%H-%M-%S")
|
|
new_date = original_date + timedelta(hours=hour_number)
|
|
new_date = original_date + timedelta(hours=hour_number)
|
|
@@ -121,6 +123,9 @@ if __name__ == '__main__':
|
|
|
|
|
|
if not callback_json or not camera_mp4 or not drive_csv or not pcd_forwardlook_mp4 or not pcd_overlook_mp4 or not pos_orig_csv or not scenario_orig_mp4 or not scenario_orig_xosc:
|
|
if not callback_json or not camera_mp4 or not drive_csv or not pcd_forwardlook_mp4 or not pcd_overlook_mp4 or not pos_orig_csv or not scenario_orig_mp4 or not scenario_orig_xosc:
|
|
continue
|
|
continue
|
|
|
|
+ error_bag_list = parse_json_to_string_array(error_bag_json)
|
|
|
|
+ if str(obj1.key) in error_bag_list:
|
|
|
|
+ continue
|
|
time.sleep(2)
|
|
time.sleep(2)
|
|
logging.info("发送: %s" % str(obj1.key))
|
|
logging.info("发送: %s" % str(obj1.key))
|
|
# 1 获取json内容
|
|
# 1 获取json内容
|
|
@@ -190,7 +195,7 @@ if __name__ == '__main__':
|
|
bucket.batch_delete_objects(old_delete_list)
|
|
bucket.batch_delete_objects(old_delete_list)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
error_bag_list = parse_json_to_string_array(error_bag_json)
|
|
error_bag_list = parse_json_to_string_array(error_bag_json)
|
|
- error_bag_list.append(parse_prefix)
|
|
|
|
|
|
+ error_bag_list.append(str(obj1.key))
|
|
list_to_json_file(error_bag_list, error_bag_json)
|
|
list_to_json_file(error_bag_list, error_bag_json)
|
|
continue
|
|
continue
|
|
|
|
|