| 54 | } |
| 55 | |
| 56 | bool AbnormalNodeMgr::IsAbnormalNode(const std::string& addr, const std::string& uuid) { |
| 57 | MutexLock lock(&mutex_); |
| 58 | if (nodes_abnormal_infos_.find(addr) == nodes_abnormal_infos_.end()) { |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | NodeAbnormalInfo& info = nodes_abnormal_infos_[addr]; |
| 63 | if (get_micros() / 1000000 >= info.recovery_time) { |
| 64 | return false; |
| 65 | } else { |
| 66 | DelayAddNode(addr, uuid); |
| 67 | return true; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | std::string AbnormalNodeMgr::GetNodeInfo(const std::string& addr) { |
| 72 | MutexLock lock(&mutex_); |