design design batch
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -14,6 +15,7 @@ def oss_upload_json(oss_client, json_data, object_name):
|
||||
file_path = os.path.join(save_dir, object_name)
|
||||
with open(file_path, 'w') as file:
|
||||
json.dump(json_data, file, indent=4)
|
||||
oss_client.fput_object("test", object_name, file_path)
|
||||
json_bytes = json.dumps(json_data).encode('utf-8')
|
||||
oss_client.put_object("test", object_name, io.BytesIO(json_bytes), length=len(json_bytes), content_type="application/json")
|
||||
except Exception as e:
|
||||
logger.warning(str(e))
|
||||
|
||||
Reference in New Issue
Block a user