Commit e2581e79 by lei

1

parent 1627ef9c
...@@ -11,7 +11,7 @@ class AliyunOss(object): ...@@ -11,7 +11,7 @@ class AliyunOss(object):
self.endpoint = "oss-cn-shenzhen.aliyuncs.com" # 阿里云从Bucket中查询到的endpoint self.endpoint = "oss-cn-shenzhen.aliyuncs.com" # 阿里云从Bucket中查询到的endpoint
self.bucket = oss2.Bucket(self.auth, self.endpoint, self.bucket_name) self.bucket = oss2.Bucket(self.auth, self.endpoint, self.bucket_name)
def put_object_from_file(self, name, file): async def put_object_from_file(self, name, file):
""" """
:param name: 在阿里云Bucket中要保存的文件名 :param name: 在阿里云Bucket中要保存的文件名
......
...@@ -192,7 +192,7 @@ class ImageSplit: ...@@ -192,7 +192,7 @@ class ImageSplit:
logger.info('图像增强结束') logger.info('图像增强结束')
# 上传阿里云 # 上传阿里云
name = f"files/download/admin/{new_uuid}" name = f"files/download/admin/{new_uuid}"
result_img = AliyunOss().put_object_from_file(name, file_path) result_img = await AliyunOss().put_object_from_file(name, file_path)
if result_img: if result_img:
# 回调 # 回调
await self.task_callback(result_img) await self.task_callback(result_img)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment