I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 470b8c59 authored by zzz's avatar zzz
Browse files

minor console/update cleanups

parent 81975e91
No related branches found
No related tags found
No related merge requests found
......@@ -558,6 +558,11 @@ public class ConsoleUpdateManager implements UpdateManager {
* Call once for each type/method pair.
*/
public void register(Updater updater, UpdateType type, UpdateMethod method, int priority) {
if ((type == ROUTER_SIGNED || type == ROUTER_UNSIGNED) && NewsHelper.dontInstall(_context)) {
if (_log.shouldLog(Log.WARN))
_log.warn("Ignoring registration for " + type + ", router updates disabled");
return;
}
// DEBUG slow start for snark updates
// For 0.9.4 update, only for dev builds
// For 0.9.5 update, only for dev builds and 1% more
......
......@@ -230,10 +230,12 @@ public class NewsHelper extends ContentHelper {
* @since 0.9.4 moved from NewsFetcher
*/
public static boolean dontInstall(RouterContext ctx) {
boolean disabled = ctx.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_DISABLED);
if (disabled)
return true;
File test = new File(ctx.getBaseDir(), "history.txt");
boolean readonly = ((test.exists() && !test.canWrite()) || (!ctx.getBaseDir().canWrite()));
boolean disabled = ctx.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_DISABLED);
return readonly || disabled;
return readonly;
}
/**
......
......@@ -55,7 +55,7 @@ public class StatSummarizer implements Runnable {
private Thread _thread;
public StatSummarizer() {
_context = RouterContext.listContexts().get(0); // fuck it, only summarize one per jvm
_context = RouterContext.listContexts().get(0); // only summarize one per jvm
_log = _context.logManager().getLog(getClass());
_listeners = new CopyOnWriteArrayList();
_instance = this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment