From e1dbd00bf504d8ebadeb8f3f590f16d7750aaf85 Mon Sep 17 00:00:00 2001
From: David Ostrovsky <david@ostrovsky.org>
Date: Thu, 10 Apr 2014 18:58:09 -0400
Subject: [PATCH] Expose new property: sshCommandStartThreads
---
src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java | 3 ++-
src/main/distrib/data/gitblit.properties | 6 ++++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/main/distrib/data/gitblit.properties b/src/main/distrib/data/gitblit.properties
index 762344b..1a613e2 100644
--- a/src/main/distrib/data/gitblit.properties
+++ b/src/main/distrib/data/gitblit.properties
@@ -129,6 +129,12 @@
# SINCE 1.5.0
git.sshBackend = NIO2
+# Number of thread for starting SSH commands.
+#
+# SINCE 1.5.0
+git.sshCommandStartThreads = 2
+
+
# Allow push/pull over http/https with JGit servlet.
# If you do NOT want to allow Git clients to clone/push to Gitblit set this
# to false. You might want to do this if you are only using ssh:// or git://.
diff --git a/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java b/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
index 8f7144d..55090fc 100644
--- a/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
+++ b/src/main/java/com/gitblit/transport/ssh/commands/SshCommandFactory.java
@@ -36,6 +36,7 @@
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;
@@ -58,7 +59,7 @@
public SshCommandFactory(IGitblit gitblit, IdGenerator idGenerator) {
this.gitblit = gitblit;
- int threads = 2;// cfg.getInt("sshd","commandStartThreads", 2);
+ int threads = gitblit.getSettings().getInteger(Keys.git.sshCommandStartThreads, 2);
WorkQueue workQueue = new WorkQueue(idGenerator);
startExecutor = workQueue.createQueue(threads, "SshCommandStart");
destroyExecutor = Executors.newSingleThreadExecutor(
--
Gitblit v1.9.1