Fix bug in s3 delete directory (#11344)

This commit is contained in:
plat1ko
2022-07-30 18:31:32 +08:00
committed by GitHub
parent 0497d58943
commit fb90586122

View File

@ -174,6 +174,9 @@ Status S3FileSystem::delete_directory(const Path& path) {
Aws::S3::Model::ListObjectsV2Request request;
auto prefix = get_key(path);
if (!prefix.empty() && prefix.back() != '/') {
prefix.push_back('/');
}
request.WithBucket(_s3_conf.bucket).WithPrefix(prefix);
Aws::S3::Model::DeleteObjectsRequest delete_request;