Permalink
Browse files

Merge pull request #36 from jenkinsci/fix-caching

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 eb0a48514f4d4c310523ad11e27556fc85b0c576
Showing with 5 additions and 5 deletions.
  1. +5 −5 ui/src/main/js/model/job-history-listener.js
@@ -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;
}
@@ -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

0 comments on commit eb0a485

Please sign in to comment.