logging and a catastrophic try/catch (no situations have called for this yet, but its worth testing for)

This commit is contained in:
jrandom
2004-05-12 07:47:22 +00:00
committed by zzz
parent 406048f7b9
commit 61f6871cd1

View File

@ -47,6 +47,7 @@ public class Timestamper implements Runnable {
public void run() {
if (_log.shouldLog(Log.INFO))
_log.info("Starting up timestamper");
try {
while (true) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Querying servers " + _serverList);
@ -60,6 +61,9 @@ public class Timestamper implements Runnable {
}
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) {
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();
// ignore the content
} catch (MalformedURLException mue) {