| 28 | ConfigUpdateCbTable::~ConfigUpdateCbTable() {} |
| 29 | |
| 30 | void |
| 31 | ConfigUpdateCbTable::insert(INKContInternal *contp, const char *name, const char *file_name) |
| 32 | { |
| 33 | ink_assert(contp != nullptr); |
| 34 | ink_assert(name != nullptr); |
| 35 | |
| 36 | if (nullptr != file_name) { |
| 37 | swoc::file::path file_path{file_name}; |
| 38 | std::error_code ec; |
| 39 | auto timestamp = swoc::file::last_write_time(file_path, ec); |
| 40 | |
| 41 | if (!ec) { |
| 42 | cb_table.emplace(name, std::make_tuple(contp, file_path, timestamp)); |
| 43 | } else { |
| 44 | Error("Failed to stat %s: %s", file_path.c_str(), ec.message().c_str()); |
| 45 | } |
| 46 | } else { |
| 47 | cb_table.emplace(name, std::make_tuple(contp, swoc::file::path{}, swoc::file::file_time_type{})); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | void |
| 52 | ConfigUpdateCbTable::invoke() |
no test coverage detected