Paul Martin
2016-04-16 eecaad8b8e2c447429c31a01d49260ddd6b4ee03
src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
@@ -1,4 +1,5 @@
/*
 * Copyright (C) 2009 The Android Open Source Project
 * Copyright 2014 gitblit.com.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -36,30 +37,26 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.gitblit.Keys;
import com.gitblit.manager.IGitblit;
import com.gitblit.transport.ssh.SshDaemonClient;
import com.gitblit.utils.IdGenerator;
import com.gitblit.utils.WorkQueue;
import com.google.common.util.concurrent.Atomics;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
/**
 *
 * @author Eric Myhre
 *
 */
public class SshCommandFactory implements CommandFactory {
   private static final Logger logger = LoggerFactory.getLogger(SshCommandFactory.class);
   private final WorkQueue workQueue;
   private final IGitblit gitblit;
   private final ScheduledExecutorService startExecutor;
   private final ExecutorService destroyExecutor;
   public SshCommandFactory(IGitblit gitblit, IdGenerator idGenerator) {
   public SshCommandFactory(IGitblit gitblit, WorkQueue workQueue) {
      this.gitblit = gitblit;
      this.workQueue = workQueue;
      int threads = 2;// cfg.getInt("sshd","commandStartThreads", 2);
      WorkQueue workQueue = new WorkQueue(idGenerator);
      int threads = gitblit.getSettings().getInteger(Keys.git.sshCommandStartThreads, 2);
      startExecutor = workQueue.createQueue(threads, "SshCommandStart");
      destroyExecutor = Executors.newSingleThreadExecutor(
            new ThreadFactoryBuilder()
@@ -73,7 +70,7 @@
   }
   public RootDispatcher createRootDispatcher(SshDaemonClient client, String commandLine) {
      return new RootDispatcher(gitblit, client, commandLine);
      return new RootDispatcher(gitblit, client, commandLine, workQueue);
   }
   @Override