提交 76e1848a 编写于 作者: K kohsuke

added the new version of the add method with custom quiet period.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3227 71c3de6d-444a-0410-be80-ed276b4c234a
上级 108fe1d7
......@@ -158,7 +158,16 @@ public class Queue {
* false if the queue contained it and therefore the add()
* was noop
*/
public synchronized boolean add( AbstractProject p ) {
public boolean add( AbstractProject p ) {
return add(p,p.getQuietPeriod());
}
/**
* Schedules a new build with a custom quiet period.
*
* @since 1.105
*/
public synchronized boolean add( AbstractProject p, int quietPeriod ) {
if(contains(p))
return false; // no double queueing
......@@ -166,7 +175,7 @@ public class Queue {
// put the item in the queue
Calendar due = new GregorianCalendar();
due.add(Calendar.SECOND, p.getQuietPeriod());
due.add(Calendar.SECOND, quietPeriod);
queue.add(new Item(due,p));
scheduleMaintenance(); // let an executor know that a new item is in the queue.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册