I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 00a5d195 authored by zzz's avatar zzz
Browse files

Limit wait for NTP to 45 seconds (ticket #1725)

parent 2d1ac7b2
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ public class RouterTimestamper extends Timestamper { ...@@ -45,6 +45,7 @@ public class RouterTimestamper extends Timestamper {
private static final int MAX_CONSECUTIVE_FAILS = 10; private static final int MAX_CONSECUTIVE_FAILS = 10;
private static final int DEFAULT_TIMEOUT = 10*1000; private static final int DEFAULT_TIMEOUT = 10*1000;
private static final int SHORT_TIMEOUT = 5*1000; private static final int SHORT_TIMEOUT = 5*1000;
private static final long MAX_WAIT_INITIALIZATION = 45*1000;
public static final String PROP_QUERY_FREQUENCY = "time.queryFrequencyMs"; public static final String PROP_QUERY_FREQUENCY = "time.queryFrequencyMs";
public static final String PROP_SERVER_LIST = "time.sntpServerList"; public static final String PROP_SERVER_LIST = "time.sntpServerList";
...@@ -141,7 +142,7 @@ public class RouterTimestamper extends Timestamper { ...@@ -141,7 +142,7 @@ public class RouterTimestamper extends Timestamper {
try { try {
synchronized (this) { synchronized (this) {
if (!_initialized) if (!_initialized)
wait(); wait(MAX_WAIT_INITIALIZATION);
} }
} catch (InterruptedException ie) {} } catch (InterruptedException ie) {}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment