MCPcopy Create free account
hub / github.com/ByConity/ByConity / clearOldStoreDirectory

Function clearOldStoreDirectory

programs/server/Server.cpp:389–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389static 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
417void Server::createServer(const std::string & listen_host, const char * port_name, bool listen_try, CreateServerFunc && func) const
418{

Callers 1

mainMethod · 0.85

Calls 13

tryLogCurrentExceptionFunction · 0.85
startsWithFunction · 0.50
getFunction · 0.50
StringClass · 0.50
getTypeMethod · 0.45
iterateDirectoryMethod · 0.45
isValidMethod · 0.45
nextMethod · 0.45
nameMethod · 0.45
getPathMethod · 0.45
pathMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected