admin
2021-01-04 aa6ef62aef83e277d4171df1d9f0803f91738216
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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();
    }
}