From 5a05dffdcef69a39e7abca5211d0430af10e46f9 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 5 Jul 2020 13:19:43 +1200 Subject: [PATCH] Have jenkins update wait for queued builds, unable to catch pending though. --- .../disguise/utilities/updates/LDJenkins.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java b/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java index 363fb73d..a8e46142 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java @@ -88,6 +88,22 @@ public class LDJenkins { for (Map map : (List) lastBuild.get("builds")) { String result = (String) map.get("result"); + if (result == null || result.equalsIgnoreCase("null")) { + if (version == null) { + DisguiseUtilities.getLogger() + .info("Jenkins build is pending.. Sleeping and checking again in 10 seconds"); + + try { + Thread.sleep(10000); + } + catch (InterruptedException e) { + e.printStackTrace(); + } + + return getLatestSnapshot(); + } + } + Object items = ((Map) map.get("changeSet")).get("items"); boolean release = false;