Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
ae6cb4aa22
@ -14,6 +14,7 @@ import redis.clients.jedis.JedisPoolConfig;
|
||||
import redis.clients.jedis.Pipeline;
|
||||
import redis.clients.jedis.Response;
|
||||
import redis.clients.jedis.Transaction;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
|
||||
public class PortalRepository
|
||||
{
|
||||
@ -64,9 +65,18 @@ public class PortalRepository
|
||||
serverTransfers.add(serverTransfer);
|
||||
}
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
_jedisPool.returnBrokenResource(jedis);
|
||||
jedis = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
if (jedis != null)
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
}
|
||||
}
|
||||
|
||||
return serverTransfers;
|
||||
@ -91,9 +101,18 @@ public class PortalRepository
|
||||
transaction.set(dataKey, serializedTransfer);
|
||||
transaction.exec();
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
_jedisPool.returnBrokenResource(jedis);
|
||||
jedis = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
if (jedis != null)
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,9 +143,18 @@ public class PortalRepository
|
||||
removedTransfer = true;
|
||||
}
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
_jedisPool.returnBrokenResource(jedis);
|
||||
jedis = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
if (jedis != null)
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
}
|
||||
}
|
||||
|
||||
return removedTransfer;
|
||||
|
@ -69,7 +69,12 @@ public class RedisServerRepository implements ServerRepository
|
||||
for (Response<String> response : responses)
|
||||
{
|
||||
String serializedData = response.get();
|
||||
servers.add(Utility.deserialize(serializedData, MinecraftServer.class));
|
||||
MinecraftServer server = Utility.deserialize(serializedData, MinecraftServer.class);
|
||||
|
||||
if (server != null)
|
||||
{
|
||||
servers.add(server);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
|
Loading…
Reference in New Issue
Block a user