| 13 | } |
| 14 | |
| 15 | TenantDatabase::TenantDatabase() { |
| 16 | auto assets = Root::singleton().assets(); |
| 17 | |
| 18 | auto& files = assets->scanExtension("tenant"); |
| 19 | assets->queueJsons(files); |
| 20 | for (auto& file : files) { |
| 21 | try { |
| 22 | String name = assets->json(file).getString("name"); |
| 23 | if (m_paths.contains(name)) |
| 24 | Logger::error("Tenant {} defined twice, second time from {}", name, file); |
| 25 | else |
| 26 | m_paths[name] = file; |
| 27 | } catch (std::exception const& e) { |
| 28 | Logger::error("Error loading tenant file {}: {}", file, outputException(e, true)); |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | void TenantDatabase::cleanup() { |
| 34 | MutexLocker locker(m_cacheMutex); |
nothing calls this directly
no test coverage detected