MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / refresh

Method refresh

dependencies/hueplusplus-1.0.0/src/APICache.cpp:47–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45{ }
46
47void 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
69nlohmann::json& APICache::getValue()
70{

Callers

nothing calls this directly

Calls 2

needsRefreshMethod · 0.80
GETRequestMethod · 0.80

Tested by

no test coverage detected