From 95bb322cd7eff27073e9f4f98f0e38f3c1db669b Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sat, 16 Jan 2010 18:58:02 +0000
Subject: [PATCH] Clock: Change a CRIT to an ERROR, lower threshold for
 changing from 10s to 5s

---
 core/java/src/net/i2p/util/Clock.java           | 6 +++---
 router/java/src/net/i2p/router/RouterClock.java | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/java/src/net/i2p/util/Clock.java b/core/java/src/net/i2p/util/Clock.java
index a3b6a44a46..91fe2d9fb8 100644
--- a/core/java/src/net/i2p/util/Clock.java
+++ b/core/java/src/net/i2p/util/Clock.java
@@ -50,8 +50,8 @@ public class Clock implements Timestamper.UpdateListener {
     public final static long MAX_OFFSET = 3 * 24 * 60 * 60 * 1000;
     /** after we've started up and shifted the clock, don't allow shifts of more than 10 minutes */
     public final static long MAX_LIVE_OFFSET = 10 * 60 * 1000;
-    /** if the clock skewed changes by less than 1s, ignore the update (so we don't slide all over the place) */
-    public final static long MIN_OFFSET_CHANGE = 10 * 1000;
+    /** if the clock skewed changes by less than this, ignore the update (so we don't slide all over the place) */
+    public final static long MIN_OFFSET_CHANGE = 5 * 1000;
 
     public void setOffset(long offsetMs) {
         setOffset(offsetMs, false);        
@@ -60,7 +60,7 @@ public class Clock implements Timestamper.UpdateListener {
     /**
      * Specify how far away from the "correct" time the computer is - a positive
      * value means that we are slow, while a negative value means we are fast.
-     *
+     * Warning - overridden in RouterClock
      */
     public void setOffset(long offsetMs, boolean force) {
         if (false) return;
diff --git a/router/java/src/net/i2p/router/RouterClock.java b/router/java/src/net/i2p/router/RouterClock.java
index d071013b2d..b6731b0fde 100644
--- a/router/java/src/net/i2p/router/RouterClock.java
+++ b/router/java/src/net/i2p/router/RouterClock.java
@@ -84,7 +84,7 @@ public class RouterClock extends Clock {
 
         if (_alreadyChanged) {
             if (delta > 15*1000)
-                getLog().log(Log.CRIT, "Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
+                getLog().error("Warning - Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
             else if (getLog().shouldLog(Log.INFO))
                 getLog().info("Updating clock offset to " + offsetMs + "ms from " + _offset + "ms");
             
-- 
GitLab