Changeset 500246e for router


Ignore:
Timestamp:
Jun 1, 2019 7:46:09 PM (10 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b5de815
Parents:
0a774c6c
Message:

NetDB: Don't wait for all RIs to be read in on Android
to tell the router we've loaded them, lets i2ptunnel start faster.

File:
1 edited

Legend:

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

    r0a774c6c r500246e  
    4141import net.i2p.util.SecureDirectory;
    4242import net.i2p.util.SecureFileOutputStream;
     43import net.i2p.util.SystemVersion;
    4344
    4445/**
     
    435436                }
    436437                Collections.shuffle(toRead, _context.random());
     438                int i = 0;
    437439                for (File file : toRead) {
    438440                    Hash key = getRouterInfoHash(file.getName());
    439                     if (key != null && !isKnown(key))
     441                    if (key != null && !isKnown(key)) {
    440442                        (new ReadRouterJob(file, key)).runJob();
     443                        if (i++ == 150 && SystemVersion.isAndroid() && !_initialized) {
     444                            // Can take 2 minutes to load them all on Android,
     445                            // after we have already built expl. tunnels.
     446                            // This is enough to let i2ptunnel get started.
     447                            // Do not set _initialized yet so we don't start rescanning.
     448                            _context.router().setNetDbReady();
     449                        }
     450                    }
    441451                }
    442452            }
Note: See TracChangeset for help on using the changeset viewer.