Author: mreutegg
Date: Tue Jul 15 07:44:24 2014
New Revision: 1610603

URL: http://svn.apache.org/r1610603
Log:
OAK-1968: Wrong time unit for async index lease time

Allow override of lease timeout with system property

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java?rev=1610603&r1=1610602&r2=1610603&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
 Tue Jul 15 07:44:24 2014
@@ -74,7 +74,18 @@ public class AsyncIndexUpdate implements
      * timed out. Another node in cluster would wait for timeout before
      * taking over a running job
      */
-    private static final long ASYNC_TIMEOUT = TimeUnit.MINUTES.toMillis(15);
+    private static final long ASYNC_TIMEOUT;
+
+    static {
+        int value = 15;
+        try {
+            value = Integer.parseInt(System.getProperty(
+                    "oak.async.lease.timeout", "15"));
+        } catch (NumberFormatException e) {
+            // use default
+        }
+        ASYNC_TIMEOUT = TimeUnit.MINUTES.toMillis(value);
+    }
 
     private final String name;
 


Reply via email to