提交 91ef9113 编写于 作者: O Oleg Nenashev

Merge pull request #1230 from daniel-beck/JENKINS-22934

[FIXED JENKINS-22934] Show poll thread count option when necessary.
......@@ -46,6 +46,8 @@ import hudson.util.TimeUnit2;
import hudson.util.SequentialExecutionQueue;
import org.apache.commons.io.FileUtils;
import org.apache.commons.jelly.XMLOutput;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.DataBoundConstructor;
......@@ -261,6 +263,15 @@ public class SCMTrigger extends Trigger<SCMedItem> {
resizeThreadPool();
}
@Restricted(NoExternalUse.class)
public boolean isPollingThreadCountOptionVisible() {
// unless you have a fair number of projects, this option is likely pointless.
// so let's hide this option for new users to avoid confusing them
// unless it was already changed
return Jenkins.getInstance().getAllItems(AbstractProject.class).size() > 10
|| getPollingThreadCount() != 0;
}
/**
* Update the {@link ExecutorService} instance.
*/
......
......@@ -24,11 +24,7 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:if test="${app.items.size()>10}">
<!--
unless you have a fair number of projects, this option is likely pointless.
so let's hide this option for new users to avoid confusing them.
-->
<j:if test="${descriptor.pollingThreadCountOptionVisible}">
<f:section title="${%SCM Polling}">
<f:entry title="${%Max # of concurrent polling}" field="pollingThreadCount">
<f:number value="${descriptor.pollingThreadCount==0 ? '' : descriptor.pollingThreadCount}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册