master
周文涛 2 years ago
parent c545729918
commit e5eb15019d

@ -11,12 +11,15 @@ import org.jeecg.modules.ocr.entity.OcrIdentify;
import org.jeecg.modules.ocr.model.TaskModel;
import org.jeecg.modules.ocr.service.IOcrIdentifyService;
import org.jeecg.modules.ocr.service.impl.TaskService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Async;
import javax.annotation.Resource;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -36,18 +39,19 @@ public class HandleTransInit implements ApplicationRunner {
TaskService taskService;
@Resource
IOcrIdentifyService ocrIdentifyService;
@Value("${enableHandleTask}")
private boolean enableHandleTask;
public static void main(String[] args) {
}
/**
*
*
* @param args
*/
@Override
@Async
public void run(ApplicationArguments args) {
public void run(ApplicationArguments args) throws UnknownHostException {
if (enableHandleTask) {
try {
Thread.sleep(5000l);
} catch (InterruptedException e) {
@ -76,6 +80,8 @@ public class HandleTransInit implements ApplicationRunner {
}
}
}
/**
*
*

@ -4,3 +4,4 @@ spring:
profiles:
# active: '@profile.name@'
active: dev
enableHandleTask: false
Loading…
Cancel
Save