| 387 | } |
| 388 | |
| 389 | static void clearOldStoreDirectory(const DisksMap& disk_map) |
| 390 | { |
| 391 | for (const auto& [name, disk] : disk_map) |
| 392 | { |
| 393 | if (disk->getType() != DiskType::Type::Local) |
| 394 | { |
| 395 | continue; |
| 396 | } |
| 397 | |
| 398 | for (auto iter = disk->iterateDirectory(""); iter->isValid(); iter->next()) |
| 399 | { |
| 400 | if (!startsWith(iter->name(), "remove_auxility_store_")) |
| 401 | continue; |
| 402 | |
| 403 | try |
| 404 | { |
| 405 | LOG_DEBUG(&Poco::Logger::get(__func__), "Removing {} from disk {}", |
| 406 | String(fs::path(disk->getPath()) / iter->path()), disk->getName()); |
| 407 | disk->removeRecursive(iter->path()); |
| 408 | } |
| 409 | catch (...) |
| 410 | { |
| 411 | tryLogCurrentException(__PRETTY_FUNCTION__); |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | void Server::createServer(const std::string & listen_host, const char * port_name, bool listen_try, CreateServerFunc && func) const |
| 418 | { |
no test coverage detected