summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-19 22:25:22 -0400
committerJames Moger <james.moger@gitblit.com>2012-03-19 22:25:22 -0400
commit273cb9014658ee5f931a191e3a2f6065d7c2657f (patch)
treef41bf50fb77d504498631e1b6d0e333938e64ee7 /src
parent22a8a61991c4364632dd4faafa21edc33b06c257 (diff)
downloadgitblit-273cb9014658ee5f931a191e3a2f6065d7c2657f.tar.gz
gitblit-273cb9014658ee5f931a191e3a2f6065d7c2657f.zip
Eliminated Lucene settings
Diffstat (limited to 'src')
-rw-r--r--src/com/gitblit/GitBlit.java21
-rw-r--r--src/com/gitblit/LuceneExecutor.java20
-rw-r--r--src/com/gitblit/wicket/pages/RootPage.java4
3 files changed, 6 insertions, 39 deletions
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index b2e53d67..7b557d79 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -87,7 +87,6 @@ import com.gitblit.utils.JsonUtils;
import com.gitblit.utils.MetricUtils;
import com.gitblit.utils.ObjectCache;
import com.gitblit.utils.StringUtils;
-import com.gitblit.utils.TimeUtils;
/**
* GitBlit is the servlet context listener singleton that acts as the core for
@@ -957,12 +956,6 @@ public class GitBlit implements ServletContextListener {
// create repository
logger.info("create repository " + repository.name);
r = JGitUtils.createRepository(repositoriesFolder, repository.name);
-
- // automatically index master branch if Lucene integration is enabled
- if (luceneExecutor.isReady()) {
- repository.indexedBranches = new ArrayList<String>();
- repository.indexedBranches.add("refs/heads/master");
- }
} else {
// rename repository
if (!repositoryName.equalsIgnoreCase(repository.name)) {
@@ -1845,18 +1838,8 @@ public class GitBlit implements ServletContextListener {
logger.warn("Mail server is not properly configured. Mail services disabled.");
}
luceneExecutor = new LuceneExecutor(settings, repositoriesFolder);
- if (luceneExecutor.isReady()) {
- String idle = settings.getString(Keys.lucene.frequency, "2 mins");
- int mins = TimeUtils.convertFrequencyToMinutes(idle);
- if (mins <= 2) {
- mins = 2;
- idle = mins + " mins";
- }
- logger.info("Lucene executor is scheduled to process ref changes every " + idle);
- scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, mins, TimeUnit.MINUTES);
- } else {
- logger.warn("Lucene integration is disabled.");
- }
+ logger.info("Lucene executor is scheduled to process indexed branches every 2 minutes.");
+ scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2, TimeUnit.MINUTES);
if (startFederation) {
configureFederation();
}
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java
index e859947d..db604a0a 100644
--- a/src/com/gitblit/LuceneExecutor.java
+++ b/src/com/gitblit/LuceneExecutor.java
@@ -148,26 +148,12 @@ public class LuceneExecutor implements Runnable {
}
/**
- * Indicates if the Lucene executor can index repositories.
- *
- * @return true if the Lucene executor is ready to index repositories
- */
- public boolean isReady() {
- return storedSettings.getBoolean(Keys.lucene.enable, false);
- }
-
- /**
- * Run is executed by the gitblit executor service at whatever frequency
- * is specified in the settings. Because this is called by an executor
- * service, calls will queue - i.e. there can never be concurrent execution
- * of repository index updates.
+ * Run is executed by the Gitblit executor service. Because this is called
+ * by an executor service, calls will queue - i.e. there can never be
+ * concurrent execution of repository index updates.
*/
@Override
public void run() {
- if (!isReady()) {
- return;
- }
-
for (String repositoryName: GitBlit.self().getRepositoryList()) {
RepositoryModel model = GitBlit.self().getRepositoryModel(repositoryName);
if (model.hasCommits && !ArrayUtils.isEmpty(model.indexedBranches)) {
diff --git a/src/com/gitblit/wicket/pages/RootPage.java b/src/com/gitblit/wicket/pages/RootPage.java
index f110cb31..bf811f94 100644
--- a/src/com/gitblit/wicket/pages/RootPage.java
+++ b/src/com/gitblit/wicket/pages/RootPage.java
@@ -101,9 +101,7 @@ public abstract class RootPage extends BasePage {
pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class,
getRootPageParameters()));
pages.add(new PageRegistration("gb.activity", ActivityPage.class, getRootPageParameters()));
- if (GitBlit.getBoolean(Keys.lucene.enable, false)) {
- pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));
- }
+ pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));
if (showAdmin) {
pages.add(new PageRegistration("gb.users", UsersPage.class));
}