MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / UpdateRelayAlive

Method UpdateRelayAlive

src/render_panel/gr_statistics.cpp:231–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229 }
230
231 void GrStatistics::UpdateRelayAlive(const std::string& device_id, int64_t timestamp) {
232 auto opt_ra = relays_alive_.TryGet(device_id);
233 if (opt_ra.has_value()) {
234 auto ra = opt_ra.value();
235 ra->last_update_ts_ = timestamp;
236 }
237 else {
238 auto ra = std::make_shared<GrStatRelayAlive>();
239 ra->device_id_ = device_id;
240 ra->created_ts_ = timestamp;
241 ra->last_update_ts_ = timestamp;
242 relays_alive_.Insert(device_id, ra);
243 }
244 }
245
246 int64_t GrStatistics::GetRelayLastUpdateTimestamp(const std::string& device_id) {
247 if (auto r = relays_alive_.TryGet(device_id); r.has_value()) {

Callers 1

ParseRendererMessageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected