diff --git a/edison-jobs/src/main/resources/static/internal/js/logLoader.js b/edison-jobs/src/main/resources/static/internal/js/logLoader.js index c694c3e96..7cb94a847 100644 --- a/edison-jobs/src/main/resources/static/internal/js/logLoader.js +++ b/edison-jobs/src/main/resources/static/internal/js/logLoader.js @@ -16,10 +16,10 @@ function getLog(logIndex) { jobStatus.html("UNKNOWN"); }, success: function (data, textStatus, xhr) { - var newLogIndex = data.messages.length - 1; + var numberOfMessages = data.messages.length; var logWindow = $('.logWindow'); - while (logIndex <= newLogIndex) { + while (logIndex < numberOfMessages) { if (logIndex === 0) { logWindow.empty(); } @@ -37,7 +37,7 @@ function getLog(logIndex) { //Schedule further polling if still runnin' if (data.state === 'Running') { setTimeout(function () { - getLog(newLogIndex) + getLog(logIndex) }, 2000); } else { var jobStatus = $('#job-status');