提交 e465f720 编写于 作者: U unknown

[FIXED JENKINS-13454] Optimize the plugin manager

上级 0f08dc0c
......@@ -114,6 +114,16 @@ public class UpdateSite {
*/
private transient volatile long retryWindow;
/**
* lastModified time of the data file when it was last read.
*/
private transient long dataLastReadFromFile;
/**
* Latest data as read from the data file.
*/
private Data data;
/**
* ID string for this update source.
*/
......@@ -309,14 +319,22 @@ public class UpdateSite {
}
/**
* Loads the update center data, if any.
* Loads the update center data, if any and if modified since last read.
*
* @return null if no data is available.
*/
public Data getData() {
JSONObject o = getJSONObject();
if (o!=null) return new Data(o);
return null;
TextFile df = getDataFile();
if (df.exists() && dataLastReadFromFile != df.file.lastModified()) {
JSONObject o = getJSONObject();
if (o!=null) {
data = new Data(o);
dataLastReadFromFile = df.file.lastModified();
} else {
data = null;
}
}
return data;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册