only log reseed network disconnected warning once

This commit is contained in:
zzz
2015-06-02 20:44:10 +00:00
parent 39dc60cf8a
commit 8a69dc0a97

View File

@@ -31,6 +31,7 @@ public class ReseedChecker {
private final AtomicBoolean _inProgress = new AtomicBoolean(); private final AtomicBoolean _inProgress = new AtomicBoolean();
private volatile String _lastStatus = ""; private volatile String _lastStatus = "";
private volatile String _lastError = ""; private volatile String _lastError = "";
private volatile boolean _networkLogged;
public static final int MINIMUM = 50; public static final int MINIMUM = 50;
private static final long STATUS_CLEAN_TIME = 20*60*1000; private static final long STATUS_CLEAN_TIME = 20*60*1000;
@@ -79,9 +80,13 @@ public class ReseedChecker {
File noReseedFileAlt3 = new File(_context.getConfigDir(), "noreseed.i2p"); File noReseedFileAlt3 = new File(_context.getConfigDir(), "noreseed.i2p");
if (!noReseedFile.exists() && !noReseedFileAlt1.exists() && !noReseedFileAlt2.exists() && !noReseedFileAlt3.exists()) { if (!noReseedFile.exists() && !noReseedFileAlt1.exists() && !noReseedFileAlt2.exists() && !noReseedFileAlt3.exists()) {
if (!Addresses.isConnected()) { if (!Addresses.isConnected()) {
_log.logAlways(Log.WARN, "Cannot reseed, no network connection"); if (!_networkLogged) {
_log.logAlways(Log.WARN, "Cannot reseed, no network connection");
_networkLogged = true;
}
return false; return false;
} }
_networkLogged = false;
if (count <= 1) if (count <= 1)
_log.logAlways(Log.INFO, "Downloading peer router information for a new I2P installation"); _log.logAlways(Log.INFO, "Downloading peer router information for a new I2P installation");
else else