diff --git a/node_modules/sync.js b/node_modules/sync.js index 9fe38179..8f0f022d 100644 --- a/node_modules/sync.js +++ b/node_modules/sync.js @@ -521,8 +521,8 @@ var Sync = { return; } Api.getSyncTags(afterUsn, me._tagMaxEntry, function(tags) { - log('syncTags------------------------------------') - log(tags); + // console.log(afterUsn + ' syncTags------------------------------------') + // console.log(tags); if(Common.isOk(tags)) { me._totalSyncTagNum += tags.length; // 证明可能还有要同步的 @@ -547,8 +547,8 @@ var Sync = { // 同步失败 me._syncInfo.tag.ok = false; me._syncInfo.tag.msg = "cann't get all chunks"; - console.log(tags); - console.log('tags eeeeeeeeeeeeeeeeeerrror') + console.error('tags eeeeeeeeeeeeeeeeeerrror') + // console.log(tags); callback && callback(false); } }); @@ -566,10 +566,9 @@ var Sync = { // 为了避免全都重新来过, 这里保存每次 updateSyncUsn: function (type, usn) { - console.error('-------------------------------------------------'); - console.log(type + ' = ' + usn); - User.updateEachSyncState(type, usn, function() { - }); + // console.error('---') + // console.log(type + ' = ' + usn); + User.updateEachSyncState(type, usn, function() {}); }, // 全量同步 @@ -609,13 +608,19 @@ var Sync = { if(ok) { // Web.syncTagFinish(); // 同步标签 - me.syncTag(tagUsn, function() { - // 更新上次同步时间 - me.updateLastSyncState(function() { - // send changes - // me.sendChanges(); - callback && callback(me._syncInfo, true); - }); + me.syncTag(tagUsn, function(ok) { + if (ok) { + // 更新上次同步时间 + me.updateLastSyncState(function() { + // send changes + // me.sendChanges(); + callback && callback(me._syncInfo, true); + }); + } + else { + console.error('syncTag error....'); + callback && callback(me._syncInfo, false); + } }); } else { console.error('syncNote error.... 跳过tag');