diff --git a/src/main/java/geektime/im/lecture/redis/EmbededRedis.java b/src/main/java/geektime/im/lecture/redis/EmbededRedis.java index b1bb9e8..ef729bf 100644 --- a/src/main/java/geektime/im/lecture/redis/EmbededRedis.java +++ b/src/main/java/geektime/im/lecture/redis/EmbededRedis.java @@ -13,12 +13,14 @@ public class EmbededRedis { @Value("${spring.redis.port}") private int redisPort; + @Value("${spring.redis.maxheap}") + private String maxheap; private RedisServer redisServer; @PostConstruct public void startRedis() throws IOException { - redisServer = new RedisServer(redisPort); + redisServer = RedisServer.builder().setting("maxheap "+maxheap).port(redisPort).setting("bind localhost").build(); redisServer.start(); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index fc02114..e7d5eaf 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -21,8 +21,9 @@ spring: ddl-auto: update redis: - host: localhost + host: 127.0.0.1 port: 6379 + maxheap: 200m websocket: connector: