| 35 | } |
| 36 | |
| 37 | bool MasterClientBase::GetAddrFromCache(const std::string &key, proto::Addr &addr) { |
| 38 | auto &&it(addr_cache_.find(key)); |
| 39 | if (it != addr_cache_.end()) { |
| 40 | if (static_cast<uint64_t>(time(nullptr)) > it->second.second) return false; |
| 41 | addr = it->second.first; |
| 42 | return true; |
| 43 | } |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | void MasterClientBase::RemoveCache(const std::string &key) { |
| 48 | addr_cache_.erase(key); |
nothing calls this directly
no outgoing calls
no test coverage detected