Authored by hugufei

SKN信息的缓存时间配置到CacheTimeConstants中

... ... @@ -6,6 +6,7 @@ import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.recall.scene.constants.CacheTimeConstants;
import com.yoho.search.recall.scene.models.CacheSknInfoRequestResponse;
import com.yoho.search.service.base.SearchCommonService;
import com.yoho.search.service.base.index.ProductIndexBaseService;
... ... @@ -35,8 +36,6 @@ public class BacthSknInfoComponent {
private static final boolean useEhCache = true;
private static final int cacheTimeInSecond = 10;
/**
* 按skn查询并按顺序返回
... ... @@ -64,7 +63,7 @@ public class BacthSknInfoComponent {
//1、构建请求与返回结果
final List<CacheSknInfoRequestResponse> sknInfoCacheRequestRespons = new ArrayList<>();
for (Integer productSkn : productSkns) {
sknInfoCacheRequestRespons.add(new CacheSknInfoRequestResponse(productSkn,cacheTimeInSecond));//缓存时间5分钟
sknInfoCacheRequestRespons.add(new CacheSknInfoRequestResponse(productSkn, CacheTimeConstants.SKN_INFO));
}
//2、批量从缓存中获取
cacheRequestResponseHelper.batchFillResponseFromCache(sknInfoCacheRequestRespons,useEhCache);
... ...
... ... @@ -11,4 +11,7 @@ public class CacheTimeConstants {
public static final int SORT_PRICE = 30 * 60;//品类价格带的缓存
public static final int SKN_INFO = 10 * 60;//缓存
}
... ...