提交 4998a373 编写于 作者: J Jesse Glick 提交者: Vojtech Juranek

[FIXED JENKINS-16244] View.hasPeople too slow to use in...

[FIXED JENKINS-16244] View.hasPeople too slow to use in sidepanel.jelly.(cherry picked from commit 73aac107)

Conflicts:
	changelog.html
上级 5f7ad6e5
......@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Slow rendering of view pages in large installations due to eager check whether the “People” link would show anything.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16244">issue 16244</a>)
<li class=bug>
Using file parameters could cause build records to not load.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13536">issue 13536</a>)
......
......@@ -635,6 +635,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
/**
* Does this {@link View} has any associated user information recorded?
* @deprecated Potentially very expensive call; do not use from Jelly views.
*/
public boolean hasPeople() {
return People.isApplicable(getItems());
......@@ -716,6 +717,9 @@ public abstract class View extends AbstractModelObject implements AccessControll
return new Api(this);
}
/**
* @deprecated Potentially very expensive call; do not use from Jelly views.
*/
public static boolean isApplicable(Collection<? extends Item> items) {
for (Item item : items) {
for (Job job : item.getAllJobs()) {
......@@ -793,6 +797,7 @@ public abstract class View extends AbstractModelObject implements AccessControll
}
}
}
// XXX consider also adding the user of the UserCause when applicable
buildCount++;
progress((itemCount + 1.0 * buildCount / builds.size()) / (items.size() + 1));
}
......
......@@ -981,6 +981,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
/**
* Does this {@link View} has any associated user information recorded?
* @deprecated Potentially very expensive call; do not use from Jelly views.
*/
public boolean hasPeople() {
return View.People.isApplicable(items.values());
......
......@@ -47,9 +47,9 @@ THE SOFTWARE.
<j:when test="${it.class.name=='hudson.model.AllView'}">
<l:task icon="images/24x24/user.png" href="${rootURL}/asynchPeople/" title="${%People}" />
</j:when>
<j:when test="${it.isDefault() or it.hasPeople()}">
<j:otherwise>
<l:task icon="images/24x24/user.png" href="${rootURL}/${it.viewUrl}asynchPeople/" title="${%People}" />
</j:when>
</j:otherwise>
</j:choose>
<l:task icon="images/24x24/notepad.png" href="${rootURL}/${it.viewUrl}builds" title="${%Build History}"/>
<j:if test="${it.isEditable()}">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册