From 59e6377da8399ae9ea13c3a41403067ba6834e80 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 23 Aug 2007 16:48:20 +0000
Subject: [PATCH] Fix the issue where changing the time-interval of a logger doesn't work if the previous value is longer then the new value. If the previous  value was set to a long time (ie 5 hours), the new value wouldn't take effect until the previous 5 hours has expired. With this fix, the new  value will take effect immediately by interrupting the rotator thread if its asleep.

---
 opends/src/server/org/opends/server/loggers/MultifileTextWriter.java |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/loggers/MultifileTextWriter.java b/opends/src/server/org/opends/server/loggers/MultifileTextWriter.java
index a4b3d52..82fe31b 100644
--- a/opends/src/server/org/opends/server/loggers/MultifileTextWriter.java
+++ b/opends/src/server/org/opends/server/loggers/MultifileTextWriter.java
@@ -343,6 +343,12 @@
   public void setInterval(long interval)
   {
     this.interval = interval;
+
+    // Wake up the thread if its sleeping on the old interval
+    if(rotaterThread.getState() == Thread.State.TIMED_WAITING)
+    {
+      rotaterThread.interrupt();
+    }
   }
 
   /**

--
Gitblit v1.10.0