| 143 | } |
| 144 | |
| 145 | bool FreqCtrlConfig::Apply(const std::string & db_name, bool is_write_query) { |
| 146 | auto itr = db_bucket_.find(db_name); |
| 147 | if (itr == db_bucket_.end()) { |
| 148 | return true; |
| 149 | } |
| 150 | bool ret = true; |
| 151 | if (is_write_query) { |
| 152 | ret = itr->second->ApplyWriteToken(1); |
| 153 | } else { |
| 154 | ret = itr->second->ApplyReadToken(1); |
| 155 | } |
| 156 | return ret; |
| 157 | } |
| 158 | |
| 159 | } |
| 160 |
no test coverage detected