Changeset 8a78de2


Ignore:
Timestamp:
Sep 20, 2011 3:28:16 AM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
aec3976
Parents:
a139d91
Message:

limit max explore queue

File:
1 edited

Legend:

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

    ra139d91 r8a78de2  
    132132    protected final static long PUBLISH_JOB_DELAY = 5*60*1000l;
    133133
     134    private static final int MAX_EXPLORE_QUEUE = 128;
     135
    134136    public KademliaNetworkDatabaseFacade(RouterContext context) {
    135137        _context = context;
     
    185187    public void queueForExploration(Set<Hash> keys) {
    186188        if (!_initialized) return;
    187         _exploreKeys.addAll(keys);
     189        for (Iterator<Hash> iter = keys.iterator(); iter.hasNext() && _exploreKeys.size() < MAX_EXPLORE_QUEUE; ) {
     190            _exploreKeys.add(iter.next());
     191        }
    188192        _context.statManager().addRateData("netDb.exploreKeySet", _exploreKeys.size(), 0);
    189193    }
Note: See TracChangeset for help on using the changeset viewer.