forked from TuxCoding/FastLogin
Prevent thread create violation in BungeeCord
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
######1.3.1
|
||||||
|
|
||||||
|
* Prevent thread create violation in BungeeCord
|
||||||
|
|
||||||
######1.3
|
######1.3
|
||||||
|
|
||||||
* Added support for AuthMe 3.X
|
* Added support for AuthMe 3.X
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.github.games647</groupId>
|
<groupId>com.github.games647</groupId>
|
||||||
<artifactId>fastlogin</artifactId>
|
<artifactId>fastlogin</artifactId>
|
||||||
<version>1.3</version>
|
<version>1.3.1</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.github.games647</groupId>
|
<groupId>com.github.games647</groupId>
|
||||||
<artifactId>fastlogin</artifactId>
|
<artifactId>fastlogin</artifactId>
|
||||||
<version>1.3</version>
|
<version>1.3.1</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.github.games647.fastlogin.bungee;
|
|||||||
|
|
||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
|
|
||||||
@ -14,6 +15,7 @@ import java.util.UUID;
|
|||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
||||||
|
|
||||||
public class Storage {
|
public class Storage {
|
||||||
|
|
||||||
@ -42,6 +44,14 @@ public class Storage {
|
|||||||
databaseConfig.setUsername(user);
|
databaseConfig.setUsername(user);
|
||||||
databaseConfig.setPassword(pass);
|
databaseConfig.setPassword(pass);
|
||||||
databaseConfig.setDriverClassName(driver);
|
databaseConfig.setDriverClassName(driver);
|
||||||
|
String pluginName = plugin.getDescription().getName();
|
||||||
|
|
||||||
|
//set a custom thread factory to remove BungeeCord warning about different threads
|
||||||
|
databaseConfig.setThreadFactory(new ThreadFactoryBuilder()
|
||||||
|
.setNameFormat(pluginName + " Database Pool Thread #%1$d")
|
||||||
|
//Hikari create daemons by default
|
||||||
|
.setDaemon(true)
|
||||||
|
.setThreadFactory(new GroupedThreadFactory(plugin, pluginName)).build());
|
||||||
|
|
||||||
databasePath = databasePath.replace("{pluginDir}", plugin.getDataFolder().getAbsolutePath());
|
databasePath = databasePath.replace("{pluginDir}", plugin.getDataFolder().getAbsolutePath());
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -8,7 +8,7 @@
|
|||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>FastLogin</name>
|
<name>FastLogin</name>
|
||||||
<version>1.3</version>
|
<version>1.3.1</version>
|
||||||
<inceptionYear>2015</inceptionYear>
|
<inceptionYear>2015</inceptionYear>
|
||||||
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
|
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
|
||||||
<description>
|
<description>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.github.games647</groupId>
|
<groupId>com.github.games647</groupId>
|
||||||
<artifactId>fastlogin</artifactId>
|
<artifactId>fastlogin</artifactId>
|
||||||
<version>1.3</version>
|
<version>1.3.1</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user