New code for updated import routine.

This commit is contained in:
James Cole
2018-05-01 20:47:38 +02:00
parent cd75224cdd
commit ccda71ff8e
16 changed files with 262 additions and 97 deletions

View File

@@ -24,8 +24,9 @@ var timeOutId;
var hasStartedJob = false;
var checkInitialInterval = 1000;
var checkNextInterval = 500;
var maxLoops = 20;
var maxLoops = 60;
var totalLoops = 0;
var startCount = 0;
$(function () {
"use strict";
@@ -50,6 +51,10 @@ function reportOnJobStatus(data) {
console.log(data);
switch (data.status) {
case "ready_to_run":
if (startCount > 0) {
hasStartedJob = false;
}
startCount++;
startJob();
checkOnJob();
break;
@@ -57,8 +62,14 @@ function reportOnJobStatus(data) {
showProgressBox();
checkOnJob();
break;
case "need_job_config":
// redirect user to configuration for this job.
window.location.replace(jobConfigurationUri);
break;
default:
console.error('Cannot handle status ' + data.status);
}
}