Change comments on configs; default ports for all storage backends
This commit is contained in:
committed by
Luck
Unverified
parent
0abe9598f6
commit
f8a77cf809
@@ -49,8 +49,9 @@ public class RedisMessaging implements MessagingService {
|
||||
private LPSub sub;
|
||||
|
||||
public void init(String address, String password) {
|
||||
String host = address.substring(0, address.indexOf(':'));
|
||||
int port = Integer.parseInt(address.substring(address.indexOf(":") + 1));
|
||||
String[] addressSplit = address.split(":");
|
||||
String host = addressSplit[0];
|
||||
int port = addressSplit.length > 1 ? Integer.parseInt(addressSplit[1]) : 6379;
|
||||
|
||||
if (password.equals("")) {
|
||||
jedisPool = new JedisPool(new JedisPoolConfig(), host, port);
|
||||
@@ -91,7 +92,7 @@ public class RedisMessaging implements MessagingService {
|
||||
private final LuckPermsPlugin plugin;
|
||||
private final Set<UUID> receivedMsgs = Collections.synchronizedSet(new HashSet<>());
|
||||
|
||||
public UUID generateId() {
|
||||
UUID generateId() {
|
||||
UUID uuid = UUID.randomUUID();
|
||||
receivedMsgs.add(uuid);
|
||||
return uuid;
|
||||
|
||||
@@ -139,10 +139,10 @@ public class MongoDBBacking extends AbstractBacking {
|
||||
}
|
||||
}
|
||||
|
||||
ServerAddress address = new ServerAddress(
|
||||
configuration.getAddress().split(":")[0],
|
||||
Integer.parseInt(configuration.getAddress().split(":")[1])
|
||||
);
|
||||
String[] addressSplit = configuration.getAddress().split(":");
|
||||
String host = addressSplit[0];
|
||||
int port = addressSplit.length > 1 ? Integer.parseInt(addressSplit[1]) : 27017;
|
||||
ServerAddress address = new ServerAddress(host, port);
|
||||
|
||||
if (credential == null) {
|
||||
mongoClient = new MongoClient(address, Collections.emptyList());
|
||||
|
||||
Reference in New Issue
Block a user