提交 62726699 编写于 作者: K Kohsuke Kawaguchi

Only show the upgrade banner when Jenkins is in charge

上级 ee5c1a3a
......@@ -10,6 +10,7 @@ import org.apache.commons.io.FileUtils;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.WebApp;
import org.kohsuke.stapler.interceptor.RequirePOST;
import javax.inject.Inject;
......@@ -86,6 +87,11 @@ public class UpgradeWizard extends PageDecorator {
if (!jenkins.hasPermission(Jenkins.ADMINISTER))
return false;
// only show when Jenkins is fully up & running
WebApp wa = WebApp.getCurrent();
if (wa==null || !(wa.getApp() instanceof Jenkins))
return false;
return System.currentTimeMillis() > getStateFile().lastModified();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册