MCPcopy Create free account
hub / github.com/apache/trafficserver / cleanup

Method cleanup

src/proxy/http/remap/PluginFactory.cc:281–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281void
282PluginFactory::cleanup()
283{
284 std::error_code ec;
285 std::string path(RecConfigReadRuntimeDir());
286
287 try {
288 if (path.starts_with("/") && std::filesystem::is_directory(path)) {
289 for (const auto &entry : std::filesystem::directory_iterator(path, ec)) {
290 if (entry.is_directory()) {
291 std::string dir_name = entry.path().string();
292 int dash_count = std::count(dir_name.begin(), dir_name.end(), '-'); // All UUIDs have 4 dashes
293
294 if (dash_count == 4) {
295 std::filesystem::remove_all(dir_name, ec);
296 }
297 }
298 }
299 }
300 } catch (std::exception &e) {
301 PluginError("Error cleaning up runtime directory: %s", e.what());
302 }
303}
304
305/**
306 * @brief Find a plugin by path from our linked plugin list by using plugin effective (canonical) path

Callers

nothing calls this directly

Calls 9

RecConfigReadRuntimeDirFunction · 0.85
is_directoryFunction · 0.85
remove_allFunction · 0.85
starts_withMethod · 0.45
stringMethod · 0.45
pathMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected