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:
parent
6f202e2117
commit
5389deb152
1 changed files with 6 additions and 3 deletions
|
@ -73,19 +73,22 @@ public class Watchdog implements Runnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this.counter.get() % 30 == 0) {
|
if (this.counter.get() % 30 == 0) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String imagerPath = ServerConfiguration.getString("site.imaging.path");
|
String imagerPath = GameConfiguration.getInstance().getString("site.imaging.path");
|
||||||
|
|
||||||
if (!imagerPath.isBlank()) {
|
if (!imagerPath.isBlank()) {
|
||||||
try {
|
try {
|
||||||
URL url = new URL(imagerPath);
|
URL url = new URL(imagerPath);
|
||||||
String hostname = url.getHost();
|
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);
|
IS_IMAGER_ONLINE = isServerOnline(hostname, port);
|
||||||
} catch (MalformedURLException e) { }
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue