提交 b3166a03 编写于 作者: K kohsuke

[HUDSON-4590] only send a request up to every once in 10 seconds in order to...

[HUDSON-4590] only send a request up to every once in 10 seconds in order to avoid hitting java.net too hard when it's about to recover from an outage.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@22348 71c3de6d-444a-0410-be80-ed276b4c234a
上级 967531a1
......@@ -64,7 +64,7 @@ public class DownloadService extends PageDecorator {
if(Hudson.getInstance().hasPermission(Hudson.READ)) {
long now = System.currentTimeMillis();
for (Downloadable d : Downloadable.all()) {
if(d.getDue()<now) {
if(d.getDue()<now && d.lastAttempt+10*1000<now) {
buf.append("<script>")
.append("Behaviour.addLoadEvent(function() {")
.append(" downloadService.download(")
......@@ -79,6 +79,7 @@ public class DownloadService extends PageDecorator {
.append("null);")
.append("});")
.append("</script>");
d.lastAttempt = now;
}
}
}
......@@ -110,6 +111,7 @@ public class DownloadService extends PageDecorator {
private final String url;
private final long interval;
private volatile long due=0;
private volatile long lastAttempt=Long.MIN_VALUE;
/**
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册