clear up a race where the timestamper might be fired when it shouldnt be
This commit is contained in:
@ -20,7 +20,7 @@ public class Timestamper implements Runnable {
|
|||||||
private List _servers;
|
private List _servers;
|
||||||
private List _listeners;
|
private List _listeners;
|
||||||
private int _queryFrequency;
|
private int _queryFrequency;
|
||||||
private boolean _disabled;
|
private volatile boolean _disabled;
|
||||||
private boolean _daemon;
|
private boolean _daemon;
|
||||||
|
|
||||||
private static final int DEFAULT_QUERY_FREQUENCY = 5*60*1000;
|
private static final int DEFAULT_QUERY_FREQUENCY = 5*60*1000;
|
||||||
@ -102,6 +102,7 @@ public class Timestamper implements Runnable {
|
|||||||
_log.info("Starting up timestamper");
|
_log.info("Starting up timestamper");
|
||||||
try {
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
updateConfig();
|
||||||
if (!_disabled) {
|
if (!_disabled) {
|
||||||
String serverList[] = null;
|
String serverList[] = null;
|
||||||
synchronized (_servers) {
|
synchronized (_servers) {
|
||||||
@ -120,7 +121,6 @@ public class Timestamper implements Runnable {
|
|||||||
_log.log(Log.CRIT, "Unable to reach any of the NTP servers - network disconnected?");
|
_log.log(Log.CRIT, "Unable to reach any of the NTP servers - network disconnected?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateConfig();
|
|
||||||
try { Thread.sleep(_queryFrequency); } catch (InterruptedException ie) {}
|
try { Thread.sleep(_queryFrequency); } catch (InterruptedException ie) {}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
Reference in New Issue
Block a user