package com.newvideo.job;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import com.newvideo.service.imp.SolrService;
|
import com.newvideo.util.Constant;
|
import com.newvideo.util.SolrUtil;
|
|
/**
|
*
|
*
|
* @author Administrator
|
*
|
*/
|
@Component
|
public class SearchIndexUpdateJob {
|
@Resource
|
private SolrService solrService;
|
|
@Scheduled(cron = "0 2/5 * * * ? ")
|
public void doJob() {
|
if (!Constant.JobTasker)
|
return;
|
System.out.println("SearchIndexUpdateJob-doJob");
|
SolrUtil.deltaUpdate();
|
new Thread(new Runnable() {
|
|
public void run() {
|
solrService.updateUnAvaileIndex();
|
}
|
}).start();
|
}
|
}
|