| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the list of all repository models. |
| | | * |
| | | * @return list of all repository models |
| | | */ |
| | | @Override |
| | | public List<RepositoryModel> getRepositoryModels() { |
| | | long methodStart = System.currentTimeMillis(); |
| | | List<String> list = getRepositoryList(); |
| | | List<RepositoryModel> repositories = new ArrayList<RepositoryModel>(); |
| | | for (String repo : list) { |
| | | RepositoryModel model = getRepositoryModel(repo); |
| | | if (model != null) { |
| | | repositories.add(model); |
| | | } |
| | | } |
| | | long duration = System.currentTimeMillis() - methodStart; |
| | | logger.info(MessageFormat.format("{0} repository models loaded in {1} msecs", duration)); |
| | | return repositories; |
| | | } |
| | | |
| | | /** |
| | | * Returns the list of repository models that are accessible to the user. |
| | | * |
| | | * @param user |
| | |
| | | |
| | | 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() { |
| | |
| | | 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); |