|
@@ -165,8 +165,7 @@ class AiView(View):
|
|
|
for i, val in enumerate(file_path_list):
|
|
|
file_dict[val] = "{uid}/{channel}/{n_time}_{i}.jpeg".format(uid=uid, channel=channel, # 封面图
|
|
|
n_time=n_time, i=i)
|
|
|
- thread_task = threading.Thread(target=self.upload_s3, args=(file_dict, dir_path))
|
|
|
- thread_task.start()
|
|
|
+ self.upload_s3(file_dict, dir_path)
|
|
|
# time.sleep(10)
|
|
|
# 存储消息以及推送
|
|
|
is_st = 3 # 多图
|
|
@@ -308,8 +307,10 @@ class AiView(View):
|
|
|
# upload_key = "test"
|
|
|
s3.Bucket(bucket).put_object(Key=upload_path, Body=upload_data)
|
|
|
# 需要删除图片
|
|
|
+ logger = logging.getLogger('info')
|
|
|
self.del_path(dir_path)
|
|
|
self.del_path(dir_path + '.jpg')
|
|
|
+ logger.info('删除图片成功,路径为:{}'.format(dir_path))
|
|
|
return True
|
|
|
except Exception as e:
|
|
|
print(repr(e))
|