You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by no...@apache.org on 2009/09/17 13:27:37 UTC

svn commit: r816144 - /lucene/solr/trunk/src/java/org/apache/solr/handler/SnapPuller.java

Author: noble
Date: Thu Sep 17 11:27:36 2009
New Revision: 816144

URL: http://svn.apache.org/viewvc?rev=816144&view=rev
Log:
SOLR-1435 ensure that all slaves with same pollInteval fetches index at same time

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/handler/SnapPuller.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/SnapPuller.java?rev=816144&r1=816143&r2=816144&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/SnapPuller.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/SnapPuller.java Thu Sep 17 11:27:36 2009
@@ -163,7 +163,8 @@
       }
     };
     executorService = Executors.newSingleThreadScheduledExecutor();
-    executorService.scheduleAtFixedRate(task, pollInterval, pollInterval, TimeUnit.MILLISECONDS);
+    long initialDelay = pollInterval - (System.currentTimeMillis() % pollInterval);
+    executorService.scheduleAtFixedRate(task, initialDelay, pollInterval, TimeUnit.MILLISECONDS);
     LOG.info("Poll Scheduled at an interval of " + pollInterval + "ms");
   }