Tunnels: Minor cleanup

This commit is contained in:
zzz
2024-08-10 08:16:41 -04:00
parent 2d516512a9
commit 2285e7ce2f
2 changed files with 6 additions and 3 deletions

View File

@@ -104,7 +104,7 @@ public class TunnelPool {
_started = System.currentTimeMillis(); _started = System.currentTimeMillis();
_lastRateUpdate = _started; _lastRateUpdate = _started;
_lastLifetimeProcessed = 0; _lastLifetimeProcessed = 0;
_manager.getExecutor().repoll(); _manager.tunnelFailed();
if (_settings.isInbound() && !_settings.isExploratory()) { if (_settings.isInbound() && !_settings.isExploratory()) {
// we just reconnected and didn't require any new tunnel builders. // we just reconnected and didn't require any new tunnel builders.
// however, we /do/ want a leaseSet, so build one // however, we /do/ want a leaseSet, so build one
@@ -452,7 +452,7 @@ public class TunnelPool {
if (_settings != null) { if (_settings != null) {
if (_log.shouldLog(Log.INFO)) if (_log.shouldLog(Log.INFO))
_log.info(toString() + ": Settings updated on the pool: " + settings); _log.info(toString() + ": Settings updated on the pool: " + settings);
_manager.getExecutor().repoll(); // in case we need more _manager.tunnelFailed(); // in case we need more
} }
} }
@@ -508,7 +508,7 @@ public class TunnelPool {
remaining = _tunnels.size(); remaining = _tunnels.size();
} }
_manager.getExecutor().repoll(); _manager.tunnelFailed();
_lifetimeProcessed += info.getProcessedMessagesCount(); _lifetimeProcessed += info.getProcessedMessagesCount();
updateRate(); updateRate();

View File

@@ -631,6 +631,9 @@ public class TunnelPoolManager implements TunnelManagerFacade {
out.add(_outboundExploratory); out.add(_outboundExploratory);
} }
/**
* Poke the build executor to build more tunnels.
*/
void tunnelFailed() { _executor.repoll(); } void tunnelFailed() { _executor.repoll(); }
BuildExecutor getExecutor() { return _executor; } BuildExecutor getExecutor() { return _executor; }