Do not block rendering of Manage Jenkins while waiting for UC data (#4881)

Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
This commit is contained in:
Daniel BeckandDaniel Beck authored and GitHub committed 2020-08-01 08:34:18 +01:00
1 parent d9aab689f5
commit 3ea9dc6b3a
4 files changed
+25 -5

No files matched your search

+10 -4
View File
@@ -1306,10 +1306,16 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
public List<UpdateSite.Deprecation> getDeprecations() {
/* Would be much nicer to go through getInfoFromAllSites but that only works for currently published plugins */
List<UpdateSite.Deprecation> deprecations = new ArrayList<>();
for (UpdateSite site : Jenkins.get().getUpdateCenter().getSites()) {
for (Map.Entry<String, UpdateSite.Deprecation> entry : site.getData().getDeprecations().entrySet()) {
if (entry.getKey().equals(this.shortName)) {
deprecations.add(entry.getValue());
final UpdateCenter updateCenter = Jenkins.get().getUpdateCenter();
if (updateCenter.isSiteDataReady()) {
for (UpdateSite site : updateCenter.getSites()) {
final UpdateSite.Data data = site.getData();
if (data != null) {
for (Map.Entry<String, UpdateSite.Deprecation> entry : data.getDeprecations().entrySet()) {
if (entry.getKey().equals(this.shortName)) {
deprecations.add(entry.getValue());
}
}
}
}
}