| 147 | } |
| 148 | |
| 149 | int TenantCache::cleanup() { |
| 150 | int tenantsRemoved = 0; |
| 151 | std::vector<Key> keysToErase; |
| 152 | |
| 153 | for (auto& t : tenantCache) { |
| 154 | ASSERT(t.value->cacheGeneration() <= generation); |
| 155 | if (t.value->cacheGeneration() != generation) { |
| 156 | keysToErase.push_back(t.key); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | for (auto& k : keysToErase) { |
| 161 | tenantCache.erase(k); |
| 162 | tenantsRemoved++; |
| 163 | } |
| 164 | |
| 165 | return tenantsRemoved; |
| 166 | } |
| 167 | |
| 168 | std::string TenantCache::desc() const { |
| 169 | std::string s("@Generation: "); |
no test coverage detected