内置redis参数添加系统类型判断

V0.5.x
xiwa 2022-06-16 11:03:27 +08:00
parent ecef5eeeaf
commit 7bcd19fa91
1 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,13 @@ public class EmbeddedRedisConfig {
}
public static void startEmbeddedRedisServer() {
RedisServer redisServer = RedisServer.builder().setting("maxheap 200m").build();
RedisServer redisServer;
String os= System.getProperty("os.name").toLowerCase();
if(os.contains("windows")){
redisServer = RedisServer.builder().setting("maxheap 200m").build();
}else{
redisServer=new RedisServer();
}
redisServer.start();
}