MCPcopy Create free account
hub / github.com/ethereum/node-crawler / storeCache

Method storeCache

pkg/api/api.go:164–178  ·  view source on GitHub ↗
(
	clientQuery,
	languageQuery,
	osQuery,
	countryQuery,
	versionQuery string,
	whereArgs []interface{},
	r result,
)

Source from the content-addressed store, hash-verified

162}
163
164func (a *Api) storeCache(
165 clientQuery,
166 languageQuery,
167 osQuery,
168 countryQuery,
169 versionQuery string,
170 whereArgs []interface{},
171 r result,
172) {
173 a.cache.Add("c"+toQuery(clientQuery, whereArgs), r.Clients)
174 a.cache.Add("l"+toQuery(languageQuery, whereArgs), r.Languages)
175 a.cache.Add("o"+toQuery(osQuery, whereArgs), r.OperatingSystems)
176 a.cache.Add("v"+toQuery(versionQuery, whereArgs), r.Versions)
177 a.cache.Add("co"+toQuery(versionQuery, whereArgs), r.Countries)
178}
179
180func (a *Api) handleDashboard(rw http.ResponseWriter, r *http.Request) {
181 // Set's the cache to 10 minutes, which matches the same as the crawler.

Callers 1

handleDashboardMethod · 0.95

Calls 2

toQueryFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected