| | |
| | | public ServicesManager(IGitblit gitblit) { |
| | | this.settings = gitblit.getSettings(); |
| | | this.gitblit = gitblit; |
| | | int defaultThreadPoolSize = settings.getInteger(Keys.execution.defaultThreadPoolSize, 1); |
| | | this.idGenerator = new IdGenerator(); |
| | | this.workQueue = new WorkQueue(idGenerator, 1); |
| | | this.workQueue = new WorkQueue(idGenerator, defaultThreadPoolSize); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | public boolean isServingRepositories() { |
| | | return settings.getBoolean(Keys.git.enableGitServlet, true) |
| | | || (gitDaemon != null && gitDaemon.isRunning()) |
| | | || (sshDaemon != null && sshDaemon.isRunning()); |
| | | return isServingHTTP() |
| | | || isServingGIT() |
| | | || isServingSSH(); |
| | | } |
| | | |
| | | public boolean isServingHTTP() { |
| | | return settings.getBoolean(Keys.git.enableGitServlet, true); |
| | | } |
| | | |
| | | public boolean isServingGIT() { |
| | | return gitDaemon != null && gitDaemon.isRunning(); |
| | | } |
| | | |
| | | public boolean isServingSSH() { |
| | | return sshDaemon != null && sshDaemon.isRunning(); |
| | | } |
| | | |
| | | protected void configureFederation() { |
| | |
| | | @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( |