NetDB: Faster startup for non-Android too

This commit is contained in:
zzz
2019-06-08 13:14:14 +00:00
parent 46ad48d5d1
commit 7e6a92ab7b

View File

@ -441,13 +441,17 @@ public class PersistentDataStore extends TransientDataStore {
Hash key = getRouterInfoHash(file.getName());
if (key != null && !isKnown(key)) {
(new ReadRouterJob(file, key)).runJob();
if (i++ == 150 && SystemVersion.isAndroid() && !_initialized) {
if (i++ == 150 && SystemVersion.isSlow() && !_initialized) {
// Can take 2 minutes to load them all on Android,
// after we have already built expl. tunnels.
// This is enough to let i2ptunnel get started.
// Do not set _initialized yet so we don't start rescanning.
_setNetDbReady = true;
_context.router().setNetDbReady();
} else if (i == 500 && !_setNetDbReady) {
// do this for faster systems also at 500
_setNetDbReady = true;
_context.router().setNetDbReady();
}
}
}