|
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.io.IOException; |
|
|
|
import java.net.InetAddress; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.CountDownLatch; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
@ -71,7 +72,7 @@ public class DcSwitchController extends BaseController { |
|
|
|
ExecutorService executor = Executors.newFixedThreadPool(100); |
|
|
|
List<DcSwitch> collect = switchList.stream() |
|
|
|
.filter(dcSwitch -> { |
|
|
|
return dcSwitch.getAncestors().split(",").length > 1; |
|
|
|
return dcSwitch.getParentId() != null; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
CountDownLatch latch = new CountDownLatch(collect.size()); |
|
|
|
collect.forEach(dcSwitch -> { |
|
|
@ -85,6 +86,7 @@ public class DcSwitchController extends BaseController { |
|
|
|
// 失败
|
|
|
|
dcSwitch.setNetWorkStatus(0); |
|
|
|
} |
|
|
|
dcSwitch.setUpdateTime(new Date()); |
|
|
|
} catch (IOException e) { |
|
|
|
e.getMessage(); |
|
|
|
} finally { |
|
|
|