fixups after prop

This commit is contained in:
zzz
2012-08-03 18:56:53 +00:00
parent 4a1b83961d
commit 72ed1bc1ac
4 changed files with 9 additions and 5 deletions

View File

@ -923,7 +923,7 @@ public class ConsoleUpdateManager implements UpdateManager {
private void finishStatus(String msg) {
updateStatus(msg);
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 20*60*1000);
_context.simpleScheduler().addEvent(new Cleaner(msg), 20*60*1000);
}
private class Cleaner implements SimpleTimer.TimedEvent {

View File

@ -61,7 +61,7 @@ class PluginUpdateChecker extends UpdateRunner {
try {
_get = new PartialEepGet(_context, proxyHost, proxyPort, _baos, _currentURI.toString(), TrustedUpdate.HEADER_BYTES);
_get.addStatusListener(this);
_get.fetch();
_get.fetch(CONNECT_TIMEOUT);
} catch (Throwable t) {
_log.error("Error checking update for plugin", t);
}

View File

@ -105,7 +105,7 @@ class PluginUpdateRunner extends UpdateRunner {
else
_get = new EepGet(_context, 1, _updateFile, _xpi2pURL, false);
_get.addStatusListener(PluginUpdateRunner.this);
_get.fetch();
_get.fetch(CONNECT_TIMEOUT, -1, shouldProxy ? INACTIVITY_TIMEOUT : NOPROXY_INACTIVITY_TIMEOUT);
} catch (Throwable t) {
_log.error("Error downloading plugin", t);
}

View File

@ -45,6 +45,10 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
private static final String SIGNED_UPDATE_FILE = "i2pupdate.sud";
protected static final long CONNECT_TIMEOUT = 55*1000;
protected static final long INACTIVITY_TIMEOUT = 5*60*1000;
protected static final long NOPROXY_INACTIVITY_TIMEOUT = 60*1000;
public UpdateRunner(RouterContext ctx, List<URI> uris) {
super("Update Runner");
setDaemon(true);
@ -127,7 +131,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
// no retries
_get = new PartialEepGet(_context, proxyHost, proxyPort, baos, updateURL, TrustedUpdate.HEADER_BYTES);
_get.addStatusListener(UpdateRunner.this);
_get.fetch();
_get.fetch(CONNECT_TIMEOUT);
} catch (Throwable t) {
}
_isPartial = false;
@ -143,7 +147,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
else
_get = new EepGet(_context, 1, _updateFile, updateURL, false);
_get.addStatusListener(UpdateRunner.this);
_get.fetch();
_get.fetch(CONNECT_TIMEOUT, -1, shouldProxy ? INACTIVITY_TIMEOUT : NOPROXY_INACTIVITY_TIMEOUT);
} catch (Throwable t) {
_log.error("Error updating", t);
}