feat(api): test doc upload
This commit is contained in:
@@ -86,16 +86,14 @@ func (m *StorageMinio) DeleteObject(ctx context.Context, objectName string) (err
|
||||
|
||||
// MoveObject implements ObjectStorage
|
||||
func (m *StorageMinio) DeleteObjects(ctx context.Context, objectNames []string) []minio.RemoveObjectError {
|
||||
objs := make(chan minio.ObjectInfo, len(objectNames))
|
||||
for _, objectName := range objectNames {
|
||||
objs <- minio.ObjectInfo{Key: objectName}
|
||||
}
|
||||
errCh := m.client.RemoveObjects(ctx, m.bucket, objs, minio.RemoveObjectsOptions{})
|
||||
|
||||
// FIXME: why does DeleteObjects not working??
|
||||
var errors []minio.RemoveObjectError
|
||||
for err := range errCh {
|
||||
if err.Err != nil {
|
||||
errors = append(errors, err)
|
||||
for _, objectName := range objectNames {
|
||||
if err := m.DeleteObject(ctx, objectName); err != nil {
|
||||
errors = append(errors, minio.RemoveObjectError{
|
||||
ObjectName: objectName,
|
||||
Err: err,
|
||||
})
|
||||
}
|
||||
}
|
||||
return errors
|
||||
|
||||
Reference in New Issue
Block a user