Search in sources :

Example 1 with LuceneService

use of com.gitblit.service.LuceneService in project gitblit by gitblit.

the class LuceneExecutorTest method newLuceneExecutor.

private LuceneService newLuceneExecutor() {
    MemorySettings settings = new MemorySettings();
    settings.put(Keys.git.repositoriesFolder, GitBlitSuite.REPOSITORIES);
    XssFilter xssFilter = new AllowXssFilter();
    RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
    UserManager users = new UserManager(runtime, null).start();
    RepositoryManager repos = new RepositoryManager(runtime, null, users);
    return new LuceneService(settings, repos);
}
Also used : UserManager(com.gitblit.manager.UserManager) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) XssFilter(com.gitblit.utils.XssFilter) RuntimeManager(com.gitblit.manager.RuntimeManager) MemorySettings(com.gitblit.tests.mock.MemorySettings) AllowXssFilter(com.gitblit.utils.XssFilter.AllowXssFilter) RepositoryManager(com.gitblit.manager.RepositoryManager) LuceneService(com.gitblit.service.LuceneService)

Example 2 with LuceneService

use of com.gitblit.service.LuceneService in project gitblit by gitblit.

the class RepositoryManager method configureLuceneIndexing.

protected void configureLuceneIndexing() {
    luceneExecutor = new LuceneService(settings, this);
    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);
}
Also used : LuceneService(com.gitblit.service.LuceneService)

Aggregations

LuceneService (com.gitblit.service.LuceneService)2 RepositoryManager (com.gitblit.manager.RepositoryManager)1 RuntimeManager (com.gitblit.manager.RuntimeManager)1 UserManager (com.gitblit.manager.UserManager)1 MemorySettings (com.gitblit.tests.mock.MemorySettings)1 XssFilter (com.gitblit.utils.XssFilter)1 AllowXssFilter (com.gitblit.utils.XssFilter.AllowXssFilter)1