mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
New code for updated import routine.
This commit is contained in:
13
public/js/ff/import/status_v2.js
vendored
13
public/js/ff/import/status_v2.js
vendored
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user