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

This commit is contained in:
Lee
2024-04-10 12:26:47 +01:00
parent 7855b5bcca
commit 3790d4a312
5 changed files with 25 additions and 30 deletions

View File

@ -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.
*