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

Function process_config_update

src/mgmt/config/FileManager.cc:49–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47DbgCtl dbg_ctl{"filemanager"};
48
49swoc::Errata
50process_config_update(std::string const &fileName, std::string const &configName)
51{
52 Dbg(dbg_ctl, "Config update requested for '%s'. [%s]", fileName.empty() ? "Unknown" : fileName.c_str(),
53 configName.empty() ? "No config record associated" : configName.c_str());
54 swoc::Errata ret;
55 // TODO: make sure records holds the name after change, if not we should change it.
56 if (fileName == ts::filename::RECORDS) {
57 if (auto zret = RecReadYamlConfigFile(); zret) {
58 RecConfigWarnIfUnregistered();
59 } else {
60 ret.note("Error reading {}", fileName).note(zret);
61 }
62 } else if (!configName.empty()) { // Could be the case we have a child file to reload with no related config record.
63 RecT rec_type;
64 if (auto r = RecGetRecordType(configName.c_str(), &rec_type); r == REC_ERR_OKAY && rec_type == RECT_CONFIG) {
65 RecSetSyncRequired(configName.c_str());
66 } else {
67 Dbg(dbg_ctl, "Couldn't set RecSetSyncRequired for %s - RecGetRecordType ret = %d", configName.c_str(), r);
68 }
69 }
70
71 return ret;
72}
73
74// JSONRPC endpoint defs.
75const std::string CONFIG_REGISTRY_KEY_STR{"config_registry"};

Callers

nothing calls this directly

Calls 7

RecReadYamlConfigFileFunction · 0.85
RecGetRecordTypeFunction · 0.85
RecSetSyncRequiredFunction · 0.85
emptyMethod · 0.45
c_strMethod · 0.45
noteMethod · 0.45

Tested by

no test coverage detected