forked from I2P_Developers/i2p.i2p
NetDB: RI Publish improvements part 1
This commit is contained in:
@@ -926,7 +926,7 @@ public class Router implements RouterClock.ClockShiftListener {
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (_context.netDb().isInitialized()) {
|
||||
if (changed && _context.netDb().isInitialized()) {
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("NetDB ready, publishing RI");
|
||||
// any previous calls to netdb().publish() did not
|
||||
|
@@ -89,8 +89,9 @@ public class PersistentDataStore extends TransientDataStore {
|
||||
writer.start();
|
||||
}
|
||||
|
||||
// We use ReadJob.isNetDbReady() so publish() will work before the initial ReadJob is complete
|
||||
@Override
|
||||
public boolean isInitialized() { return _initialized; }
|
||||
public boolean isInitialized() { return _initialized || _readJob.isNetDbReady(); }
|
||||
|
||||
// this doesn't stop the read job or the writer, maybe it should?
|
||||
@Override
|
||||
@@ -411,6 +412,10 @@ public class PersistentDataStore extends TransientDataStore {
|
||||
requeue(0);
|
||||
}
|
||||
|
||||
public boolean isNetDbReady() {
|
||||
return _setNetDbReady;
|
||||
}
|
||||
|
||||
private void readFiles() {
|
||||
int routerCount = 0;
|
||||
|
||||
@@ -490,7 +495,7 @@ public class PersistentDataStore extends TransientDataStore {
|
||||
if (_facade.reseedChecker().checkReseed(routerCount)) {
|
||||
_lastReseed = _context.clock().now();
|
||||
// checkReseed will call wakeup() when done and we will run again
|
||||
} else {
|
||||
} else if (!_setNetDbReady) {
|
||||
_setNetDbReady = true;
|
||||
_context.router().setNetDbReady();
|
||||
}
|
||||
|
Reference in New Issue
Block a user