Commit 1f51a2be authored by Tristan Cavelier's avatar Tristan Cavelier

One job rule condition added + 2 default job rules modified

parent 5aff34da
......@@ -421,6 +421,23 @@ defaults.job_rule_conditions = {};
return a.kwargs._id === b.kwargs._id;
}
/**
* Test if the jobs have a document id.
*
* @param {Object} a The first job to test
* @param {Object} b The second job to test
* @return {Boolean} True if ids exist, else false
*/
function haveDocumentIds(a, b) {
if (typeof a.kwargs._id !== "string" || a.kwargs._id === "") {
return false;
}
if (typeof b.kwargs._id !== "string" || b.kwargs._id === "") {
return false;
}
return true;
}
/**
* Compare two jobs and test if their kwargs are equal
*
......@@ -452,7 +469,8 @@ defaults.job_rule_conditions = {};
"sameMethod": sameMethod,
"sameDocumentId": sameDocumentId,
"sameParameters": sameParameters,
"sameOptions": sameOptions
"sameOptions": sameOptions,
"haveDocumentIds": haveDocumentIds
};
}());
......@@ -210,6 +210,7 @@ function enableJobChecker(jio, shared, options) {
"sameStorageDescription",
"areWriters",
"sameMethod",
"haveDocumentIds",
"sameParameters"
],
"action": "update"
......@@ -218,6 +219,7 @@ function enableJobChecker(jio, shared, options) {
"conditions": [
"sameStorageDescription",
"areWriters",
"haveDocumentIds",
"sameDocumentId"
],
"action": "wait"
......
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