MCPcopy Create free account
hub / github.com/comaps/comaps / Load

Function Load

libs/storage/diff_scheme/diff_scheme_loader.cpp:108–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108NameDiffInfoMap Load(LocalMapsInfo const & info)
109{
110 if (info.m_localMaps.empty() || DIFF_LIST_URL[0] == 0)
111 return {};
112
113 platform::HttpClient request(DIFF_LIST_URL);
114 string const body = SerializeCheckerData(info);
115 ASSERT(!body.empty(), ());
116 request.SetBodyData(body, "application/json");
117 request.SetTimeout(kTimeoutInSeconds);
118 NameDiffInfoMap diffs;
119 if (request.RunHttpRequest() && !request.WasRedirected() && request.ErrorCode() == 200)
120 {
121 diffs = DeserializeResponse(request.ServerResponse(), info.m_localMaps);
122 }
123 else
124 {
125 ostringstream ost;
126 ost << "Request to diffs server failed. Code = " << request.ErrorCode()
127 << ", redirection = " << request.WasRedirected();
128 LOG(LINFO, (ost.str()));
129 }
130
131 return diffs;
132}
133} // namespace
134
135namespace storage

Callers 13

LoadMethod · 0.70
EliasFanoMapMethod · 0.50
GetMethod · 0.50
EnsureTableLoadedMethod · 0.50
QuerySaverMethod · 0.50
LoadVicinityMethod · 0.50
InitFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
UNIT_TESTFunction · 0.50

Calls 8

SerializeCheckerDataFunction · 0.85
ASSERTFunction · 0.85
DeserializeResponseFunction · 0.85
WasRedirectedMethod · 0.80
ErrorCodeMethod · 0.80
emptyMethod · 0.45
SetTimeoutMethod · 0.45
RunHttpRequestMethod · 0.45

Tested by 2

UNIT_TESTFunction · 0.40
UNIT_TESTFunction · 0.40