19 var jobPollQueue = [];
20 var currentTimeout = 1000;
21 var currentTimeoutObj =
"";
23 function updateCheckSuccess(data) {
24 var hasFinishedJobs =
false;
25 jobPollQueue = $.map(jobPollQueue,
function (val) {
27 var callbacksuccess = val.callbacksuccess;
28 var callbackfail = val.callbackfail;
29 if ((data[jqId]) && (data[jqId].end_bits == 1)) {
30 callbacksuccess(jqId);
33 else if ((data[jqId]) && (data[jqId].end_bits > 1)) {
41 if (jobPollQueue.length > 0) {
42 if (currentTimeout < 10000) {
43 currentTimeout += 1000;
45 currentTimeout += 1000;
46 currentTimeoutObj = setTimeout(updateCheck, currentTimeout);
48 currentTimeoutObj =
"";
52 function updateCheck() {
53 if (jobPollQueue.length > 0) {
54 var jqIds = $.map(jobPollQueue,
function (val) {
60 data: {
"jqIds": jqIds},
61 success: updateCheckSuccess,
69 function queueUpdateCheck(jqPk, callbacksucess, callbackfail) {
70 jobPollQueue.push({
"jqId": jqPk,
"callbacksuccess": callbacksucess,
"callbackfail": callbackfail});
71 currentTimeout = 1000;
72 if (currentTimeoutObj) {
73 clearTimeout(currentTimeoutObj);
75 currentTimeoutObj = setTimeout(updateCheck, currentTimeout);
79 function linkToJob(jqPk) {
80 return "<a href='?mod=showjobs&job=" + jqPk +
"'>job #" + jqPk +
"</a>";