forked from I2P_Developers/i2p.i2p
ReadConfigJob minor optimization
This commit is contained in:
@@ -24,11 +24,12 @@ import net.i2p.util.Log;
|
||||
* Unfortunately it will also read the file back in every time the
|
||||
* router writes it.
|
||||
*
|
||||
* So maybe this should just be disabled.
|
||||
* We must keep this enabled, as it's the only way for people
|
||||
* to set routerconsole.advanced=true without restarting.
|
||||
*/
|
||||
public class ReadConfigJob extends JobImpl {
|
||||
private final static long DELAY = 30*1000; // reread every 30 seconds
|
||||
private long _lastRead;
|
||||
private volatile long _lastRead;
|
||||
|
||||
public ReadConfigJob(RouterContext ctx) {
|
||||
super(ctx);
|
||||
@@ -50,10 +51,8 @@ public class ReadConfigJob extends JobImpl {
|
||||
}
|
||||
|
||||
private boolean shouldReread(File configFile) {
|
||||
if (!configFile.exists()) return false;
|
||||
if (configFile.lastModified() > _lastRead)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
// lastModified() returns 0 if not found
|
||||
//if (!configFile.exists()) return false;
|
||||
return configFile.lastModified() > _lastRead;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user