mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 00:21:07 +03:00
[FIX] Поддержка нового формата подключения PostgreSQL
This commit is contained in:
parent
43a43ec30d
commit
3ed166f8e7
4 changed files with 9 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -107,6 +107,6 @@ buildnumber
|
|||
*.directory
|
||||
cmd.bat
|
||||
cmd.sh
|
||||
project/target
|
||||
## PVS Studio
|
||||
.PVS-Studio/
|
||||
project/target
|
||||
|
|
|
@ -21,8 +21,8 @@ public final class PostgreSQLSourceConfig implements AutoCloseable {
|
|||
private String poolName;
|
||||
|
||||
// Config
|
||||
private String address;
|
||||
private int port;
|
||||
private String[] addresses;
|
||||
private int[] ports;
|
||||
private String username;
|
||||
private String password;
|
||||
private String database;
|
||||
|
@ -43,8 +43,8 @@ public synchronized Connection getConnection() throws SQLException {
|
|||
PGSimpleDataSource postgresqlSource = new PGSimpleDataSource();
|
||||
|
||||
// Set credentials
|
||||
postgresqlSource.setServerNames(new String[] {address}); //TODO support multinode PostgreSQL DB
|
||||
postgresqlSource.setPortNumbers(new int[] {port});
|
||||
postgresqlSource.setServerNames(addresses);
|
||||
postgresqlSource.setPortNumbers(ports);
|
||||
postgresqlSource.setUser(username);
|
||||
postgresqlSource.setPassword(password);
|
||||
postgresqlSource.setDatabaseName(database);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
import java.net.Socket;
|
||||
import java.util.Set;
|
||||
|
||||
// TODO refactor
|
||||
@SuppressWarnings("unused")
|
||||
public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
|
||||
private SSLServerSocketFactory ssf;
|
||||
|
@ -18,9 +19,6 @@ public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
|
|||
|
||||
public LauncherNettyServer nettyServer;
|
||||
|
||||
// API
|
||||
private Set<Socket> sockets;
|
||||
|
||||
private transient final LaunchServer server;
|
||||
|
||||
public NettyServerSocketHandler(LaunchServer server) {
|
||||
|
@ -29,7 +27,8 @@ public NettyServerSocketHandler(LaunchServer server) {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
//TODO: Close Impl
|
||||
nettyServer.close();
|
||||
nettyServer.service.channels.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
id 'org.openjfx.javafxplugin' version '0.0.7' apply false
|
||||
id 'org.openjfx.javafxplugin' version '0.0.8' apply false
|
||||
}
|
||||
group = 'pro.gravit.launcher'
|
||||
version = '5.1.3'
|
||||
|
|
Loading…
Reference in a new issue