| 400 | } |
| 401 | |
| 402 | std::optional<server_model_meta> server_models::get_meta(const std::string & name) { |
| 403 | std::lock_guard<std::mutex> lk(mutex); |
| 404 | auto it = mapping.find(name); |
| 405 | if (it != mapping.end()) { |
| 406 | return it->second.meta; |
| 407 | } |
| 408 | for (const auto & [key, inst] : mapping) { |
| 409 | if (inst.meta.aliases.count(name)) { |
| 410 | return inst.meta; |
| 411 | } |
| 412 | } |
| 413 | return std::nullopt; |
| 414 | } |
| 415 | |
| 416 | static int get_free_port() { |
| 417 | #ifdef _WIN32 |
no test coverage detected