Skip to content

Commit

Permalink
Merge pull request #36 from jenkinsci/fix-caching
Browse files Browse the repository at this point in the history
Fix incorrect API call from frontend which fetched all runs even if they were cached [JENKINS-40087]
  • Loading branch information
svanoort committed Nov 29, 2016
2 parents d63dca9 + d824ee3 commit eb0a485
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/src/main/js/model/job-history-listener.js
Expand Up @@ -39,17 +39,17 @@ exports.schedulePoll = function (callback) {
function setupJobPoll(jobUrl, callback, jobRunsData) {
function findSinceRunParam() {
// console.log('findSinceRunParam');
// Find the oldest build that has an in progress type status. If there's non
// that fit that, use the latest build.
// Find the name of the oldest build that has an in progress type status.
// If there's none that fit that, use the latest build.
var i = jobRunsData.length - 1;
for (; i >= 0; i--) {
var runStatus = jobRunsData[i].status;
if (runStatus === 'IN_PROGRESS' || runStatus === 'PAUSED_PENDING_INPUT') {
return jobRunsData[i].id;
return jobRunsData[i].name;
}
}
if (jobRunsData.length > 0) {
return jobRunsData[0].id;
return jobRunsData[0].name;
} else {
return undefined;
}
Expand Down Expand Up @@ -85,7 +85,7 @@ function setupJobPoll(jobUrl, callback, jobRunsData) {
notifyListeners = true;
addRun(aSinceRun);
} else {
// We know this run... has it changes?
// We know this run... has it changed?
var knownRun = jobRunsData[knownRunIndex];
if (aSinceRun.status !== knownRun.status) {
// status has changed
Expand Down

0 comments on commit eb0a485

Please sign in to comment.