李旭东
2023-11-03 a07b4b6ff1c98dcf81338bb45d59308db7c058a9
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
package com.thhy.staff.config;
 
import com.thhy.staff.modules.biz.face.controller.GetUserTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Configuration;
 
import java.util.Timer;
 
@Configuration
public class StartListener implements ApplicationRunner {
 
 
    @Value("${file.vfprefix}")
    private String vfPrefix;
 
    @Override
    public void run(ApplicationArguments args) throws Exception {
        GetUserTask gutask = new GetUserTask(vfPrefix);
        Timer timer = new Timer();
        timer.schedule(gutask,1000,300000);
    }
}