| | |
| | |
|
| | | private MailExecutor mailExecutor;
|
| | |
|
| | | private LuceneExecutor luceneExecutor;
|
| | | |
| | | private TimeZone timezone;
|
| | |
|
| | | public GitBlit() {
|
| | |
| | | if (repositoryMetricsCache.hasCurrent(model.name, model.lastChange)) {
|
| | | return new ArrayList<Metric>(repositoryMetricsCache.getObject(model.name));
|
| | | }
|
| | | List<Metric> metrics = MetricUtils.getDateMetrics(repository, null, true, null);
|
| | | List<Metric> metrics = MetricUtils.getDateMetrics(repository, null, true, null, getTimezone());
|
| | | repositoryMetricsCache.updateObject(model.name, model.lastChange, metrics);
|
| | | return new ArrayList<Metric>(metrics);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * Update the Lucene index of a repository.
|
| | | * |
| | | * @param repository
|
| | | */
|
| | | public void updateLuceneIndex(RepositoryModel repository) {
|
| | | luceneExecutor.queue(repository);
|
| | | }
|
| | |
|
| | | /**
|
| | | * Returns the descriptions/comments of the Gitblit config settings.
|
| | | *
|
| | | * @return SettingsModel
|
| | |
| | | setUserService(loginService);
|
| | | mailExecutor = new MailExecutor(settings);
|
| | | if (mailExecutor.isReady()) {
|
| | | logger.info("Mail executor is scheduled to process the message queue every 2 minutes.");
|
| | | scheduledExecutor.scheduleAtFixedRate(mailExecutor, 1, 2, TimeUnit.MINUTES);
|
| | | } else {
|
| | | logger.warn("Mail server is not properly configured. Mail services disabled.");
|
| | | }
|
| | | luceneExecutor = new LuceneExecutor(settings);
|
| | | if (luceneExecutor.isReady()) {
|
| | | logger.info("Lucene executor is scheduled to process the repository queue every 2 minutes.");
|
| | | scheduledExecutor.scheduleAtFixedRate(luceneExecutor, 1, 2, TimeUnit.MINUTES);
|
| | | } else {
|
| | | logger.warn("Lucene executor is disabled.");
|
| | | }
|
| | | if (startFederation) {
|
| | | configureFederation();
|
| | |
| | | public void contextDestroyed(ServletContextEvent contextEvent) {
|
| | | logger.info("Gitblit context destroyed by servlet container.");
|
| | | scheduledExecutor.shutdownNow();
|
| | | luceneExecutor.close();
|
| | | }
|
| | | }
|