redis test

master
Alex 2022-03-27 20:58:33 +02:00
parent 80f220c062
commit d5eb6ef5f3
2 changed files with 8 additions and 3 deletions

View File

@ -86,9 +86,8 @@ public class ProxySystem extends Plugin {
this.kraSocketClient.getSocketClient().getConnection().closeConnection(1, "");
this.mongoManager.getMongoClient().close();
//this.redisManager.getConnection().close();
//this.redisManager.getClient().shutdown();
this.redisManager.close();
instance = null;
}

View File

@ -3,6 +3,7 @@ package net.krakatoa.proxy.redis;
import lombok.Data;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.config.Config;
@Data
@ -20,6 +21,7 @@ public class RedisManager {
public void connect() {
this.config = new Config();
this.config.setCodec(new JsonJacksonCodec());
this.config.useSingleServer().setAddress(this.connectionUri);
this.redissonClient = Redisson.create(this.config);
@ -28,5 +30,9 @@ public class RedisManager {
//this.commands = connection.sync();
//this.keyReactiveCommands = this.connection.reactive();
}
public void close() {
this.redissonClient.shutdown();
}
}
// RedisKeyReactiveCommands