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

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