Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 3 years ago
parent
commit
6150d5e3dd
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      modules/storage/obs.go

+ 5
- 1
modules/storage/obs.go View File

@@ -140,6 +140,10 @@ func ObsMultiPartUpload(uuid string, uploadId string, partNumber int, fileName s

//delete all file under the dir path
func ObsRemoveObject(bucket string, path string) error {
log.Info("Bucket=" + bucket + " path=" + path)
if len(path) == 0 {
return error.Error("path cannot be null.")
}
input := &obs.ListObjectsInput{}
input.Bucket = bucket
// 设置每页100个对象
@@ -157,7 +161,7 @@ func ObsRemoveObject(bucket string, path string) error {
delObj := &obs.DeleteObjectInput{}
delObj.Bucket = setting.Bucket
delObj.Key = val.Key
ObsCli.DeleteObject(delObj)
//ObsCli.DeleteObject(delObj)
}
if output.IsTruncated {
input.Marker = output.NextMarker


Loading…
Cancel
Save