|
@@ -113,14 +113,10 @@ if __name__ == '__main__':
|
|
continue
|
|
continue
|
|
|
|
|
|
upload = False
|
|
upload = False
|
|
- if old_date is None:
|
|
|
|
|
|
+ if 'userId' in json_object:
|
|
logging.info("手动上传的数据")
|
|
logging.info("手动上传的数据")
|
|
upload = True
|
|
upload = True
|
|
old_date = ''
|
|
old_date = ''
|
|
- elif str(old_date).endswith('.bag'):
|
|
|
|
- logging.info("手动上传的数据")
|
|
|
|
- upload = True
|
|
|
|
- pass
|
|
|
|
else:
|
|
else:
|
|
logging.info("自动采集的数据")
|
|
logging.info("自动采集的数据")
|
|
upload = False
|
|
upload = False
|
|
@@ -150,11 +146,15 @@ if __name__ == '__main__':
|
|
|
|
|
|
# 处理是否上传
|
|
# 处理是否上传
|
|
if not upload:
|
|
if not upload:
|
|
- bucket.copy_object(bucket_name, old_ros_bag_path, old_ros_bag_path.replace(old_date, new_date))
|
|
|
|
- bucket.delete_object(old_ros_bag_path)
|
|
|
|
- bucket.batch_delete_objects(old_delete_list)
|
|
|
|
-
|
|
|
|
- if 'userId' in json_object:
|
|
|
|
|
|
+ try:
|
|
|
|
+ bucket.copy_object(bucket_name, old_ros_bag_path, old_ros_bag_path.replace(old_date, new_date))
|
|
|
|
+ bucket.delete_object(old_ros_bag_path)
|
|
|
|
+ bucket.batch_delete_objects(old_delete_list)
|
|
|
|
+ except Exception as e:
|
|
|
|
+ logging.exception("报错: %s" % str(e))
|
|
|
|
+ continue
|
|
|
|
+
|
|
|
|
+ if upload:
|
|
logging.info("json_object 包含 'userId' 字段,是手动上传的包,userId为:", json_object['userId'])
|
|
logging.info("json_object 包含 'userId' 字段,是手动上传的包,userId为:", json_object['userId'])
|
|
data2 = {
|
|
data2 = {
|
|
'userId': json_object['userId'],
|
|
'userId': json_object['userId'],
|