Fix Redis not working with local IPs

This commit is contained in:
Telesphoreo 2022-02-04 12:51:16 -06:00
parent 93a8a10212
commit c93bd4fd2c
2 changed files with 3 additions and 2 deletions

View File

@ -27,7 +27,7 @@ dependencies {
library 'org.json:json:20211205'
library 'commons-io:commons-io:2.11.0'
library 'dev.morphia.morphia:morphia-core:2.2.3'
library 'redis.clients:jedis:4.1.0'
library 'redis.clients:jedis:4.1.1'
library 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
library 'org.apache.httpcomponents:httpclient:4.5.13'
compileOnly 'io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT'

View File

@ -5,6 +5,7 @@ import dev.plex.PlexBase;
import dev.plex.util.PlexLog;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
public class RedisConnection extends PlexBase
{
@ -15,7 +16,7 @@ public class RedisConnection extends PlexBase
{
ClassLoader previous = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(RedisConnection.class.getClassLoader());
this.pool = new JedisPool(plugin.config.getString("data.side.hostname"), Plex.get().getConfig().getInt("data.side.port"));
this.pool = new JedisPool(new JedisPoolConfig(), plugin.config.getString("data.side.hostname"), Plex.get().getConfig().getInt("data.side.port"));
Thread.currentThread().setContextClassLoader(previous);
PlexLog.log("Connected to Redis!");
return pool;