Commit 695b5ec7 authored by Tristan Cavelier's avatar Tristan Cavelier

replicaterevisionstorage.js console.log removed

parent 656b1e56
...@@ -210,11 +210,9 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -210,11 +210,9 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
}; };
priv.repair = function (doc, option, repair, callback) { priv.repair = function (doc, option, repair, callback) {
var functions = {}; var functions = {};
// console.log("priv.repair");
callback = callback || priv.emptyFunction; callback = callback || priv.emptyFunction;
option = option || {}; option = option || {};
functions.begin = function () { functions.begin = function () {
// console.log("repair begin");
functions.getAllDocuments(functions.newParam( functions.getAllDocuments(functions.newParam(
doc, doc,
option, option,
...@@ -222,7 +220,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -222,7 +220,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
)); ));
}; };
functions.newParam = function (doc, option, repair) { functions.newParam = function (doc, option, repair) {
// console.log("repair new param");
var param = { var param = {
"doc": doc, "doc": doc,
"option": option, "option": option,
...@@ -254,7 +251,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -254,7 +251,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
return param; return param;
}; };
functions.getAllDocuments = function (param) { functions.getAllDocuments = function (param) {
// console.log("repair getAllDocument");
var i, doc = priv.clone(param.doc), option = priv.clone(param.option); var i, doc = priv.clone(param.doc), option = priv.clone(param.option);
option.conflicts = true; option.conflicts = true;
option.revs = true; option.revs = true;
...@@ -266,18 +262,15 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -266,18 +262,15 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
functions.finished_count += 1; functions.finished_count += 1;
}; };
functions.dealResults = function (param) { functions.dealResults = function (param) {
// console.log("repair dealResults");
return function (method, index, err, response) { return function (method, index, err, response) {
if (param.deal_result_state !== "ok") { if (param.deal_result_state !== "ok") {
// deal result is in a wrong state, exit // deal result is in a wrong state, exit
// console.log("repair dealResults wrong state");
return; return;
} }
if (err) { if (err) {
if (err.status !== 404) { if (err.status !== 404) {
// get document failed, exit // get document failed, exit
param.deal_result_state = "error"; param.deal_result_state = "error";
// console.log("repair dealResults error");
callback({ callback({
"status": 40, "status": 40,
"statusText": "Check Failed", "statusText": "Check Failed",
...@@ -295,19 +288,15 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -295,19 +288,15 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
// add the conflicting revision for other synchronizations // add the conflicting revision for other synchronizations
functions.addConflicts(param, (response || {})._conflicts); functions.addConflicts(param, (response || {})._conflicts);
if (param.responses.count !== param.responses.list.length) { if (param.responses.count !== param.responses.list.length) {
// this is not the last response, wait for the next response // this is not the last response, wait for the next response
// console.log("repair dealResults not last");
return; return;
} }
// console.log("repair dealResults last");
// this is now the last response
// this is now the last response
functions.makeResponsesStats(param.responses); functions.makeResponsesStats(param.responses);
if (param.responses.stats_items.length === 1) { if (param.responses.stats_items.length === 1) {
// the responses are equals! // the responses are equals!
// console.log("repair dealResults OK");
callback(undefined, { callback(undefined, {
"ok": true, "ok": true,
"id": param.doc._id, "id": param.doc._id,
...@@ -336,7 +325,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -336,7 +325,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
}; };
}; };
functions.addConflicts = function (param, list) { functions.addConflicts = function (param, list) {
// console.log("repair addConflicts");
var i; var i;
list = list || []; list = list || [];
for (i = 0; i < list.length; i += 1) { for (i = 0; i < list.length; i += 1) {
...@@ -344,7 +332,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -344,7 +332,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
} }
}; };
functions.makeResponsesStats = function (responses) { functions.makeResponsesStats = function (responses) {
// console.log("repair makeResponseStats");
var i, str_response; var i, str_response;
for (i = 0; i < responses.count; i += 1) { for (i = 0; i < responses.count; i += 1) {
str_response = JSON.stringify(responses.list[i]); str_response = JSON.stringify(responses.list[i]);
...@@ -359,7 +346,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -359,7 +346,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
} }
}; };
functions.synchronizeAllSubStorage = function (param) { functions.synchronizeAllSubStorage = function (param) {
// console.log("repair synchronizeAllSubStorage");
var i, j, len = param.responses.stats_items.length; var i, j, len = param.responses.stats_items.length;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
// browsing responses // browsing responses
...@@ -381,7 +367,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -381,7 +367,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
response, response,
storage_list storage_list
) { ) {
// console.log("repair synchronizeResponseToSubStorage");
var i, new_doc; var i, new_doc;
if (response === undefined) { if (response === undefined) {
// no response to sync // no response to sync
...@@ -404,7 +389,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -404,7 +389,6 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
} }
}; };
functions.synchronizeConflicts = function (param) { functions.synchronizeConflicts = function (param) {
// console.log("repair synchronizeConflicts");
var rev, new_doc, new_option; var rev, new_doc, new_option;
new_option = priv.clone(param.option); new_option = priv.clone(param.option);
new_option.synchronize_conflict = false; new_option.synchronize_conflict = false;
...@@ -423,10 +407,8 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -423,10 +407,8 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
}; };
functions.finished_count = 0; functions.finished_count = 0;
functions.finished = function () { functions.finished = function () {
// console.log("repair finished " + functions.finished_count);
functions.finished_count -= 1; functions.finished_count -= 1;
if (functions.finished_count === 0) { if (functions.finished_count === 0) {
// console.log("repair ended");
callback(undefined, {"ok": true, "id": doc._id}); callback(undefined, {"ok": true, "id": doc._id});
} }
}; };
......
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