forked from j62/ctbrec
1
0
Fork 0

Don't log exception if interrupted, but not running anymore

This commit is contained in:
0xboobface 2018-12-06 13:44:10 +01:00
parent 69544a7a60
commit 90e033d2ac
1 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import static ctbrec.EventBusHolder.*;
import static ctbrec.EventBusHolder.EVENT_TYPE.*;
import static ctbrec.Model.STATUS.*;
import java.io.InterruptedIOException;
import java.net.SocketTimeoutException;
import java.time.Duration;
import java.time.Instant;
@ -69,6 +70,10 @@ public class OnlineMonitor extends Thread {
model.getName(), e.getResponseCode(), e.getResponseMessage());
} catch (SocketTimeoutException e) {
LOG.error("Couldn't check if model {} is online. Request timed out", model.getName());
} catch (InterruptedException | InterruptedIOException e) {
if(running) {
LOG.error("Couldn't check if model {} is online", model.getName(), e);
}
} catch (Exception e) {
LOG.error("Couldn't check if model {} is online", model.getName(), e);
}
@ -107,7 +112,6 @@ public class OnlineMonitor extends Thread {
evt.put(OLD, oldStatus);
evt.put(MODEL, model);
EventBusHolder.BUS.post(evt);
LOG.debug("Event fired {}", evt);
}
public void shutdown() {