Changeset e0c8eb7


Ignore:
Timestamp:
Sep 12, 2011 1:08:50 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
1664072
Parents:
435bc826
Message:
  • NetDB: Disable floodfill at shutdown time if enabled
File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java

    r435bc826 re0c8eb7  
    8080    }
    8181   
     82    /**
     83     *  If we are floodfill, turn it off and tell everybody.
     84     *  @since 0.8.9
     85     */
     86    @Override
     87    public void shutdown() {
     88        if (_floodfillEnabled) {
     89            // turn off to build a new RI...
     90            _floodfillEnabled = false;
     91            // true -> publish inline
     92            // but job queue is already shut down, so sendStore() called by rebuildRouterInfo() won't work...
     93            _context.router().rebuildRouterInfo(true);
     94            // ...so force a flood here
     95            RouterInfo local = _context.router().getRouterInfo();
     96            if (local != null && _context.router().getUptime() > PUBLISH_JOB_DELAY) {
     97                flood(local);
     98                // let the messages get out...
     99                try {
     100                    Thread.sleep(3000);
     101                } catch (InterruptedException ie) {}
     102            }
     103        }
     104        super.shutdown();
     105    }
     106
    82107    /**
    83108     *  This maybe could be shorter than RepublishLeaseSetJob.REPUBLISH_LEASESET_TIMEOUT,
Note: See TracChangeset for help on using the changeset viewer.