diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-08 13:41:28 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-08 13:41:28 -0400 |
commit | 14181da41a98817aef2b528f92d58613e61e495f (patch) | |
tree | 3aaf6e9ea15ad8e4c26d15c6a47a65ff2450f062 /src/main/java/com/gitblit/manager | |
parent | 696cb684a1ba095c195cdfc750728be8e94a7add (diff) | |
parent | 936af6a24bb80fc6177ecacc44a4be79d79f3de4 (diff) | |
download | gitblit-14181da41a98817aef2b528f92d58613e61e495f.tar.gz gitblit-14181da41a98817aef2b528f92d58613e61e495f.zip |
Merge branch 'ticket/161' into develop
Diffstat (limited to 'src/main/java/com/gitblit/manager')
-rw-r--r-- | src/main/java/com/gitblit/manager/RepositoryManager.java | 12 | ||||
-rw-r--r-- | src/main/java/com/gitblit/manager/ServicesManager.java | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java index 6a22db59..d9939bd4 100644 --- a/src/main/java/com/gitblit/manager/RepositoryManager.java +++ b/src/main/java/com/gitblit/manager/RepositoryManager.java @@ -1829,9 +1829,10 @@ public class RepositoryManager implements IRepositoryManager { protected void configureLuceneIndexing() { luceneExecutor = new LuceneService(settings, this); - int period = 2; - scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, period, TimeUnit.MINUTES); - logger.info("Lucene will process indexed branches every {} minutes.", period); + String frequency = settings.getString(Keys.web.luceneFrequency, "2 mins"); + int mins = TimeUtils.convertFrequencyToMinutes(frequency, 2); + scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, mins, TimeUnit.MINUTES); + logger.info("Lucene will process indexed branches every {} minutes.", mins); } protected void configureGarbageCollector() { @@ -1866,10 +1867,7 @@ public class RepositoryManager implements IRepositoryManager { protected void configureMirrorExecutor() { mirrorExecutor = new MirrorService(settings, this); if (mirrorExecutor.isReady()) { - int mins = TimeUtils.convertFrequencyToMinutes(settings.getString(Keys.git.mirrorPeriod, "30 mins")); - if (mins < 5) { - mins = 5; - } + int mins = TimeUtils.convertFrequencyToMinutes(settings.getString(Keys.git.mirrorPeriod, "30 mins"), 5); int delay = 1; scheduledExecutor.scheduleAtFixedRate(mirrorExecutor, delay, mins, TimeUnit.MINUTES); logger.info("Mirror service will fetch updates every {} minutes.", mins); diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java index 2550f66f..71858545 100644 --- a/src/main/java/com/gitblit/manager/ServicesManager.java +++ b/src/main/java/com/gitblit/manager/ServicesManager.java @@ -510,7 +510,7 @@ public class ServicesManager implements IServicesManager { @Override public void reschedule(FederationModel registration) { // schedule the next pull - int mins = TimeUtils.convertFrequencyToMinutes(registration.frequency); + int mins = TimeUtils.convertFrequencyToMinutes(registration.frequency, 5); registration.nextPull = new Date(System.currentTimeMillis() + (mins * 60 * 1000L)); scheduledExecutor.schedule(new FederationPuller(registration), mins, TimeUnit.MINUTES); logger.info(MessageFormat.format( |