Changeset ff2d5ba


Ignore:
Timestamp:
Aug 19, 2016 3:56:31 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
47a0df76
Parents:
bcaf837
Message:

ReadConfigJob? minor optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tasks/ReadConfigJob.java

    rbcaf837 rff2d5ba  
    2525 * router writes it.
    2626 *
    27  * So maybe this should just be disabled.
     27 * We must keep this enabled, as it's the only way for people
     28 * to set routerconsole.advanced=true without restarting.
    2829 */
    2930public class ReadConfigJob extends JobImpl {
    3031    private final static long DELAY = 30*1000; // reread every 30 seconds
    31     private long _lastRead;
     32    private volatile long _lastRead;
    3233
    3334    public ReadConfigJob(RouterContext ctx) {
     
    5152   
    5253    private boolean shouldReread(File configFile) {
    53         if (!configFile.exists()) return false;
    54         if (configFile.lastModified() > _lastRead)
    55             return true;
    56         else
    57             return false;
     54        // lastModified() returns 0 if not found
     55        //if (!configFile.exists()) return false;
     56        return configFile.lastModified() > _lastRead;
    5857    }
    5958}
Note: See TracChangeset for help on using the changeset viewer.