venediktov / vanilla-rtb

Real Time Bidding (RTB) - Demand Side Platform framework

Home Page:http://forkbid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Merge loader and loader_experimental

venediktov opened this issue · comments

We don't need a separate loader for ico targeting , just add a REST handler and ico caches to
examples/loader/cache_loader_test.cpp and separate map

dispatcher.crud_match(boost::regex("/ico_cache_loader/(\\w*)"))
              .put([&](http::server::reply & r, const http::crud::crud_match<boost::cmatch> & match) {
              LOG(info) << "received cache update event url=" << match[0];
              try {
                  ico_caches[match[1]]();
              } catch (std::exception const& e) {
                  LOG(error) << e.what();
              }
    });

Also add map for ico targeting model

std::map<std::string, std::function<void()>> ico_caches = {
        {"domain" , [&domain_cache](){geo_ad_cache.load();}},
        {"ico_campaign", [&ico_campaign_cache](){co_campaign_cache.load();}   },
        {"ad"     , [&ad_cache](){ad_cache.load();}    },
        {""       , [&ico_bidder_caches] (){ico_bidder_caches.load();}    }
    };