logging and a catastrophic try/catch (no situations have called for this yet, but its worth testing for)
This commit is contained in:
@ -47,6 +47,7 @@ public class Timestamper implements Runnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (_log.shouldLog(Log.INFO))
|
if (_log.shouldLog(Log.INFO))
|
||||||
_log.info("Starting up timestamper");
|
_log.info("Starting up timestamper");
|
||||||
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Querying servers " + _serverList);
|
_log.debug("Querying servers " + _serverList);
|
||||||
@ -60,6 +61,9 @@ public class Timestamper implements Runnable {
|
|||||||
}
|
}
|
||||||
try { Thread.sleep(DELAY_MS); } catch (InterruptedException ie) {}
|
try { Thread.sleep(DELAY_MS); } catch (InterruptedException ie) {}
|
||||||
}
|
}
|
||||||
|
} catch (Throwable t) {
|
||||||
|
_log.log(Log.CRIT, "Timestamper died!", t);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -67,7 +71,10 @@ public class Timestamper implements Runnable {
|
|||||||
*/
|
*/
|
||||||
private void stampTime(long now) {
|
private void stampTime(long now) {
|
||||||
try {
|
try {
|
||||||
URL url = new URL(_targetURL + "&now=" + getNow(now));
|
String toRequest = _targetURL + "&now=" + getNow(now);
|
||||||
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
|
_log.debug("Stamping [" + toRequest + "]");
|
||||||
|
URL url = new URL(toRequest);
|
||||||
Object o = url.getContent();
|
Object o = url.getContent();
|
||||||
// ignore the content
|
// ignore the content
|
||||||
} catch (MalformedURLException mue) {
|
} catch (MalformedURLException mue) {
|
||||||
|
Reference in New Issue
Block a user