|
@@ -36,7 +36,9 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.function.Predicate;
|
|
|
import java.util.stream.Stream;
|
|
@@ -75,8 +77,17 @@ public class CarWuDanYongCheJob {
|
|
|
throw new MyRuntimeException("睿行车辆无单用车报警月统计数据没有文件");
|
|
|
}
|
|
|
for (Path path : pathList) {
|
|
|
- singleJob(path);
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
+ try {
|
|
|
+ singleJob(path);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new MyRuntimeException(e);
|
|
|
+ }
|
|
|
+ }).get(1, TimeUnit.MINUTES);
|
|
|
}
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ log.error("线程中断: {}", e.getMessage(), e);
|
|
|
+ Thread.currentThread().interrupt();
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
}
|