소스 검색

Merge branch 'hotfix/oss_0124' into debug

hsun 1 년 전
부모
커밋
e1c2e1a638
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      controllers/resource.go

+ 8 - 0
controllers/resource.go

@@ -252,6 +252,10 @@ func (this *ResourceController) VideoUpload() {
 	//savePath := utils.Upload_Audio_Dir + time.Now().Format("200601/20060102/")
 	//savePath += fileName
 
+	defer func() {
+		_ = os.Remove(fpath)
+	}()
+
 	//上传到阿里云 和 minio
 	resourceUrl := ``
 	//if utils.ObjectStorageClient == "minio" {
@@ -439,6 +443,10 @@ func (this *ResourceController) VoiceUpload() {
 	utils.FileLog.Info("start update oss ")
 	utils.FileLog.Info(fmt.Sprintf("%s:", time.Now().Format(utils.FormatDateTime)))
 
+	defer func() {
+		_ = os.Remove(fpath)
+	}()
+
 	//savePath := utils.Upload_Audio_Dir + time.Now().Format("200601/20060102/")
 	//savePath += fileName
 	//上传到阿里云 和 minio