Commit 0e0a5cb0 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Add max_wait_time to JIOGlobals

This will set the maximum duration (in ms) a job may wait for.
parent 4880ef9e
...@@ -174,7 +174,8 @@ var JIO = ...@@ -174,7 +174,8 @@ var JIO =
}, },
'localStorage': null, // where the browser stores data 'localStorage': null, // where the browser stores data
'queueID': 1, 'queueID': 1,
'storageTypeObject': {} // ex: {'type':'local','creator': fun ...} 'storageTypeObject': {}, // ex: {'type':'local','creator': fun ...}
'max_wait_time': 10000
}, },
// end jio globals // end jio globals
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
...@@ -761,9 +762,12 @@ var JIO = ...@@ -761,9 +762,12 @@ var JIO =
// Change the job status to wait for time. // Change the job status to wait for time.
// The listener will invoke this job later. // The listener will invoke this job later.
var time = (priv.job.tries*priv.job.tries*1000);
if (time > jioGlobalObj.max_wait_time) {
time = jioGlobalObj.max_wait_time;
}
priv.job.status = 'wait'; priv.job.status = 'wait';
priv.job.waitingFor = {'time':Date.now() + priv.job.waitingFor = {'time':Date.now() + time};
(priv.job.tries*priv.job.tries*1000)};
}; };
//// end Private Methods //// end Private Methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment