1
Fork 0
mirror of https://github.com/Quackster/Havana.git synced 2025-07-03 05:07:46 +00:00

Fix checking imager uptime

This commit is contained in:
Quackster 2023-01-22 10:49:30 +10:00
parent 6f202e2117
commit 5389deb152

View file

@ -73,19 +73,22 @@ public class Watchdog implements Runnable {
}
}
if (this.counter.get() % 30 == 0) {
try {
String imagerPath = ServerConfiguration.getString("site.imaging.path");
String imagerPath = GameConfiguration.getInstance().getString("site.imaging.path");
if (!imagerPath.isBlank()) {
try {
URL url = new URL(imagerPath);
String hostname = url.getHost();
int port = url.getPort() == -1 ? url.getPort() : 80;
int port = url.getPort() == -1 ? 80 : url.getPort();
IS_IMAGER_ONLINE = isServerOnline(hostname, port);
} catch (MalformedURLException e) { }
} catch (MalformedURLException e) {
e.printStackTrace();
}
}