Commit fdcffe5b authored by Tristan Cavelier's avatar Tristan Cavelier

job rule condition added + default job rules modified

parent 830ff681
......@@ -387,6 +387,23 @@ defaults.job_rule_conditions = {};
methodType(b.method) === 'writer';
}
/**
* Compare two jobs and test if they use metadata only
*
* @param {Object} a The first job to compare
* @param {Object} b The second job to compare
* @return {Boolean} True if equal, else false
*/
function useMetadataOnly(a, b) {
if (['post', 'put', 'get', 'remove', 'allDocs'].indexOf(a.method) === -1) {
return false;
}
if (['post', 'put', 'get', 'remove', 'allDocs'].indexOf(b.method) === -1) {
return false;
}
return true;
}
/**
* Compare two jobs and test if they are readers
*
......@@ -466,6 +483,7 @@ defaults.job_rule_conditions = {};
"sameStorageDescription": sameStorageDescription,
"areWriters": areWriters,
"areReaders": areReaders,
"useMetadataOnly": useMetadataOnly,
"sameMethod": sameMethod,
"sameDocumentId": sameDocumentId,
"sameParameters": sameParameters,
......
......@@ -213,10 +213,11 @@ function enableJobChecker(jio, shared, options) {
],
"action": "update"
}, {
"code_name": "writers update",
"code_name": "metadata writers update",
"conditions": [
"sameStorageDescription",
"areWriters",
"useMetadataOnly",
"sameMethod",
"haveDocumentIds",
"sameParameters"
......
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