1
|
package com.yoho.search.consumer.job;
|
1
|
package com.yoho.search.consumer.job;
|
2
|
|
2
|
|
|
|
3
|
+import com.yoho.search.consumer.service.base.ProductPriceService;
|
3
|
import org.slf4j.Logger;
|
4
|
import org.slf4j.Logger;
|
4
|
import org.slf4j.LoggerFactory;
|
5
|
import org.slf4j.LoggerFactory;
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -22,6 +23,8 @@ public class IndexRebuildJob implements ApplicationEventPublisherAware { |
|
@@ -22,6 +23,8 @@ public class IndexRebuildJob implements ApplicationEventPublisherAware { |
22
|
private IYohoIndexService yohoIndexService;
|
23
|
private IYohoIndexService yohoIndexService;
|
23
|
@Autowired
|
24
|
@Autowired
|
24
|
private RebuildFlagService rebuildFlagService;
|
25
|
private RebuildFlagService rebuildFlagService;
|
|
|
26
|
+ @Autowired
|
|
|
27
|
+ private ProductPriceService productPriceService;
|
25
|
|
28
|
|
26
|
private static final Logger logger = LoggerFactory.getLogger(IndexRebuildJob.class);
|
29
|
private static final Logger logger = LoggerFactory.getLogger(IndexRebuildJob.class);
|
27
|
|
30
|
|
|
@@ -33,6 +36,11 @@ public class IndexRebuildJob implements ApplicationEventPublisherAware { |
|
@@ -33,6 +36,11 @@ public class IndexRebuildJob implements ApplicationEventPublisherAware { |
33
|
}
|
36
|
}
|
34
|
|
37
|
|
35
|
@Scheduled(cron = "0 0 3 * * ?")
|
38
|
@Scheduled(cron = "0 0 3 * * ?")
|
|
|
39
|
+ public void rebuildIndexTask() {
|
|
|
40
|
+ productPriceService.batchUpdateHistoryPrice();
|
|
|
41
|
+ execute();
|
|
|
42
|
+ }
|
|
|
43
|
+
|
36
|
public void execute() {
|
44
|
public void execute() {
|
37
|
long begin = System.currentTimeMillis();
|
45
|
long begin = System.currentTimeMillis();
|
38
|
logger.info("indexRebuildJob execute start----[begin={}]", begin);
|
46
|
logger.info("indexRebuildJob execute start----[begin={}]", begin);
|