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

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

ReadConfigJob minor optimization

parent bcaf837d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
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