From d84b1125ebbbbd80c025342e000a9adae9583c46 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sun, 2 Aug 2009 16:16:57 +0000 Subject: [PATCH] * Timestamper: Don't start thread if not enabled --- core/java/src/net/i2p/time/Timestamper.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/java/src/net/i2p/time/Timestamper.java b/core/java/src/net/i2p/time/Timestamper.java index c452f110a1..4692c8d533 100644 --- a/core/java/src/net/i2p/time/Timestamper.java +++ b/core/java/src/net/i2p/time/Timestamper.java @@ -52,6 +52,15 @@ public class Timestamper implements Runnable { this(ctx, lsnr, true); } public Timestamper(I2PAppContext ctx, UpdateListener lsnr, boolean daemon) { + // Don't bother starting a thread if we are disabled. + // This means we no longer check every 5 minutes to see if we got enabled, + // so the property must be set at startup. + // We still need to be instantiated since the router calls clock().getTimestamper().waitForInitialization() + String disabled = ctx.getProperty(PROP_DISABLED, DEFAULT_DISABLED); + if (Boolean.valueOf(disabled).booleanValue()) { + _initialized = true; + return; + } _context = ctx; _daemon = daemon; _initialized = false; -- GitLab