Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- auto chartLinksCache =
- std::unordered_map<std::pair<time_t, time_t>, ChartLinks> {};
- auto chartLinkGenerator = [startTs, endTs, this, &chartLinksCache]() mutable {
- if (auto chartLinks = folly::get_optional(
- chartLinksCache, std::make_pair(startTs, endTs))) {
- LOG(INFO) << "got from cache" << " " << startTs << " " << endTs;
- return *chartLinks;
- }
- auto chartLinks = genChartLinks(startTs, endTs);
- LOG(INFO) << "not from cache " << " " << startTs << " " << endTs << "size"
- << chartLinksCache.size();
- chartLinksCache.emplace(std::make_pair(startTs, endTs), chartLinks);
- return chartLinks;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement