| 45 | { } |
| 46 | |
| 47 | void APICache::refresh() |
| 48 | { |
| 49 | // Only refresh part of the cache, because that is more efficient |
| 50 | if (base && base->needsRefresh()) |
| 51 | { |
| 52 | base->refresh(); |
| 53 | } |
| 54 | else |
| 55 | { |
| 56 | nlohmann::json result = commands.GETRequest(getRequestPath(), nlohmann::json::object(), CURRENT_FILE_INFO); |
| 57 | lastRefresh = std::chrono::steady_clock::now(); |
| 58 | if (base) |
| 59 | { |
| 60 | base->value[path] = std::move(result); |
| 61 | } |
| 62 | else |
| 63 | { |
| 64 | value = std::move(result); |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | nlohmann::json& APICache::getValue() |
| 70 | { |
nothing calls this directly
no test coverage detected