Browse Source

网卡选择

WANG 6 years ago
parent
commit
94b872451d

+ 7 - 0
src/main/java/cn/com/qmth/examcloud/web/bootstrap/AppBootstrap.java

@@ -86,6 +86,13 @@ public class AppBootstrap {
 			}
 		}
 
+		// 网卡选择
+		String preferredNetworks = properties.get("ocean.inet.preferredNetworks");
+		if (StringUtils.isNotBlank(preferredNetworks)) {
+			System.setProperty("spring.cloud.inetutils.preferred-networks", preferredNetworks);
+			properties.put("spring.cloud.inetutils.preferred-networks", preferredNetworks);
+		}
+
 		properties.put("spring.profiles.active", active);
 
 		Set<String> argSet = Sets.newLinkedHashSet();