优化结构
This commit is contained in:
@@ -74,7 +74,7 @@ func (s *huaweiStorage) DeletePrefix(ctx context.Context, prefix string) error {
|
||||
}
|
||||
cursor := ""
|
||||
for {
|
||||
items, next, more, err := s.List(ctx, prefix, cursor, 1000)
|
||||
items, next, more, err := s.List(ctx, prefix+"/", cursor, 1000)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -96,7 +96,7 @@ func (s *huaweiStorage) List(_ context.Context, prefix, cursor string, limit int
|
||||
if limit <= 0 {
|
||||
limit = 100
|
||||
}
|
||||
result, err := s.client.ListObjects(&obs.ListObjectsInput{ListObjsInput: obs.ListObjsInput{Prefix: s.key(prefix), MaxKeys: limit}, Bucket: s.bucket, Marker: cursor})
|
||||
result, err := s.client.ListObjects(&obs.ListObjectsInput{ListObjsInput: obs.ListObjsInput{Prefix: boundedPrefix(s.key(prefix), prefix), MaxKeys: limit}, Bucket: s.bucket, Marker: cursor})
|
||||
if err != nil {
|
||||
return nil, "", false, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user