Skip to content

Commit b93c808

Browse files
committed
new idea
1 parent a953335 commit b93c808

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/com/example/postgresdemo/Service/RedisConfig.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ public class RedisConfig {
1212
public JedisPool jedisPool() {
1313
JedisPoolConfig config = new JedisPoolConfig();
1414
config.setMaxTotal(8);
15-
config.setJmxEnabled(false); // <-- Это отключает регистрацию MBean
16-
return new JedisPool(config, "localhost", 6379);
15+
config.setJmxEnabled(false);
16+
17+
String redisHost = System.getenv("REDIS_HOST");
18+
int redisPort = Integer.parseInt(System.getenv("REDIS_PORT"));
19+
20+
return new JedisPool(config, redisHost, redisPort);
1721
}
1822
}

0 commit comments

Comments
 (0)