fix clean-up process

This commit is contained in:
Han Fei 2024-07-04 17:59:07 +02:00
parent 24ff0f601d
commit 6dd13dd34a

View File

@ -1311,9 +1311,9 @@ void removeRecursive(Coordination::ZooKeeper & zookeeper, const std::string & pa
while (!children_span.empty())
{
Coordination::Requests ops;
for (size_t i = 0; i < 1000 && !children.empty(); ++i)
for (size_t i = 0; i < 1000 && !children_span.empty(); ++i)
{
removeRecursive(zookeeper, fs::path(path) / children.back());
removeRecursive(zookeeper, fs::path(path) / children_span.back());
ops.emplace_back(zkutil::makeRemoveRequest(fs::path(path) / children_span.back(), -1));
children_span = children_span.subspan(0, children_span.size() - 1);
}