Make the max pool size configurable
This commit is contained in:
parent
270a276b98
commit
5d955e77b6
@ -149,6 +149,7 @@ data:
|
|||||||
database: minecraft
|
database: minecraft
|
||||||
username: root
|
username: root
|
||||||
password: ''
|
password: ''
|
||||||
|
pool-size: 10 # The size of the MySQL connection pool.
|
||||||
|
|
||||||
# Set to -1 to disable. If this is the only instance accessing the datastore, you can disable syncing.
|
# Set to -1 to disable. If this is the only instance accessing the datastore, you can disable syncing.
|
||||||
# e.g. if you're using sqlite or flatfile, this can be set to -1 to save resources.
|
# e.g. if you're using sqlite or flatfile, this can be set to -1 to save resources.
|
||||||
|
@ -107,6 +107,7 @@ data:
|
|||||||
database: minecraft
|
database: minecraft
|
||||||
username: root
|
username: root
|
||||||
password: ''
|
password: ''
|
||||||
|
pool-size: 10 # The size of the MySQL connection pool.
|
||||||
|
|
||||||
# Set to -1 to disable. If this is the only instance accessing the datastore, you can disable syncing.
|
# Set to -1 to disable. If this is the only instance accessing the datastore, you can disable syncing.
|
||||||
# e.g. if you're using sqlite or flatfile, this can be set to -1 to save resources.
|
# e.g. if you're using sqlite or flatfile, this can be set to -1 to save resources.
|
||||||
|
@ -130,7 +130,8 @@ public abstract class AbstractConfiguration<T extends LuckPermsPlugin> implement
|
|||||||
getString("data.address", null),
|
getString("data.address", null),
|
||||||
getString("data.database", null),
|
getString("data.database", null),
|
||||||
getString("data.username", null),
|
getString("data.username", null),
|
||||||
getString("data.password", null)
|
getString("data.password", null),
|
||||||
|
getInt("data.pool-size", 10)
|
||||||
);
|
);
|
||||||
storageMethod = getString("storage-method", defaultStorage);
|
storageMethod = getString("storage-method", defaultStorage);
|
||||||
splitStorage = getBoolean("split-storage.enabled", false);
|
splitStorage = getBoolean("split-storage.enabled", false);
|
||||||
|
@ -33,5 +33,6 @@ public class DatastoreConfiguration implements me.lucko.luckperms.api.data.Datas
|
|||||||
private final String database;
|
private final String database;
|
||||||
private final String username;
|
private final String username;
|
||||||
private final String password;
|
private final String password;
|
||||||
|
private int poolSize;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,8 @@ public class MySQLBacking extends SQLBacking {
|
|||||||
final String username = configuration.getUsername();
|
final String username = configuration.getUsername();
|
||||||
final String password = configuration.getPassword();
|
final String password = configuration.getPassword();
|
||||||
|
|
||||||
config.setMaximumPoolSize(10);
|
config.setMaximumPoolSize(configuration.getPoolSize());
|
||||||
|
|
||||||
config.setPoolName("luckperms");
|
config.setPoolName("luckperms");
|
||||||
config.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
|
config.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
|
||||||
config.addDataSourceProperty("serverName", address.split(":")[0]);
|
config.addDataSourceProperty("serverName", address.split(":")[0]);
|
||||||
|
@ -107,6 +107,7 @@ data {
|
|||||||
database="minecraft"
|
database="minecraft"
|
||||||
username="root"
|
username="root"
|
||||||
password=""
|
password=""
|
||||||
|
pool-size=10 # The size of the MySQL connection pool.
|
||||||
|
|
||||||
# Set to -1 to disable. If this is the only instance accessing the datastore, you can disable syncing.
|
# Set to -1 to disable. If this is the only instance accessing the datastore, you can disable syncing.
|
||||||
# e.g. if you're using sqlite or flatfile, this can be set to -1 to save resources.
|
# e.g. if you're using sqlite or flatfile, this can be set to -1 to save resources.
|
||||||
|
Loading…
Reference in New Issue
Block a user