提交 74af23f4 编写于 作者: K kohsuke

If a job is cancelled while it's already in the queue, remove the job from the queue.

    (<a href="http://www.nabble.com/Disabled-jobs-and-triggered-builds-td20254776.html">report</a>)


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@12960 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c914144e
......@@ -267,6 +267,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
public void makeDisabled(boolean b) throws IOException {
if(disabled==b) return; // noop
this.disabled = b;
Hudson.getInstance().getQueue().cancel(this);
save();
}
......@@ -609,6 +610,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
}
public R createExecutable() throws IOException {
if(isDisabled()) return null;
return newBuild();
}
......@@ -977,7 +979,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException {
super.submit(req,rsp);
disabled = req.getParameter("disable")!=null;
makeDisabled(req.getParameter("disable")!=null);
jdk = req.getParameter("jdk");
if(req.getParameter("hasCustomQuietPeriod")!=null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册