Set up connection pool and enforce usage of it
Attempt to initialize connection pool on startup until a timeout.
This commit is contained in:
@@ -866,8 +866,13 @@ public class Server {
|
||||
public void init() {
|
||||
System.out.println("Cosmic v" + ServerConstants.VERSION + " starting up.\r\n");
|
||||
|
||||
if(YamlConfig.config.server.SHUTDOWNHOOK)
|
||||
if(YamlConfig.config.server.SHUTDOWNHOOK) {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(shutdown(false)));
|
||||
}
|
||||
|
||||
if (!DatabaseConnection.initializeConnectionPool()) {
|
||||
throw new IllegalStateException("Failed to initiate a connection to the database");
|
||||
}
|
||||
|
||||
TimeZone.setDefault(TimeZone.getTimeZone(YamlConfig.config.server.TIMEZONE));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user