Authored by zhaoqing

CDN预热

... ... @@ -568,17 +568,19 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo>
FreshCdnUrlBO freshCdnUrlBO = new FreshCdnUrlBO();
if (floorList.size() <= 0 && bo.isPushCdn()){
//首次添加 调用接口预热CDN
logger.info("ActivtyTemplatedService :: upateActivityTemplate warm_up cdn begin");
freshCdnUrlBO.setRequest_type("warm_up");
warmAndFresh(bo, freshCdnUrlBO);
}else if (floorList.size() > 0 ){
//修改 调用接口刷新CDN
freshCdnUrlBO.setRequest_type("fresh");
logger.info("ActivtyTemplatedService :: upateActivityTemplate refresh cdn begin");
freshCdnUrlBO.setRequest_type("refresh");
warmAndFresh(bo, freshCdnUrlBO);
}
}
private void warmAndFresh(ActivtyTemplatedBo bo, FreshCdnUrlBO freshCdnUrlBO) {
logger.info("ActivtyTemplatedService :: upateActivityTemplate fresh cdn begin");
String url = "https://activity.yoho.cn/feature/"+bo.getId()+".html";
freshCdnUrlBO.setUrl(url);
logger.info("ActivtyTemplatedService :: upateActivityTemplate fresh cdn begin url is {},auth_code is {}, type is {}", url, freshCdnUrlBO.getAuth_code(), freshCdnUrlBO.getRequest_type());
... ...