change how the port is fetched from the hostname and lowered the timeout for server pings
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m33s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m33s
This commit is contained in:
@ -1,21 +1,11 @@
|
||||
package cc.fascinated.common;
|
||||
|
||||
import cc.fascinated.exception.impl.BadRequestException;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
@UtilityClass
|
||||
public class ServerUtils {
|
||||
|
||||
/**
|
||||
* Get the hostname and port from a hostname string
|
||||
*
|
||||
* @param hostname the hostname string
|
||||
* @return the hostname and port
|
||||
*/
|
||||
public static Tuple<String, Integer> getHostnameAndPort(String hostname) {
|
||||
String[] split = hostname.split(":");
|
||||
return new Tuple<>(split[0], split.length == 1 ? -1 : Integer.parseInt(split[1]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the address of the server.
|
||||
*
|
||||
|
Reference in New Issue
Block a user