This commit is contained in:
life
2021-08-14 17:46:04 +08:00
parent 5cb9825eba
commit 9c02a81da1
2 changed files with 8 additions and 4 deletions

View File

@@ -1658,7 +1658,7 @@ var Note = {
var path = attachs[i].Path; var path = attachs[i].Path;
if(path && path.indexOf(fileBasePath) >= 0) { if(path && path.indexOf(fileBasePath) >= 0) {
try { try {
fs.unlink(path); fs.unlink(path, () => {});
} catch(e) { } catch(e) {
console.error(e); console.error(e);
} }

View File

@@ -43,6 +43,7 @@ var Sync = {
}, },
*/ */
_needIncrSyncAgain: false, _needIncrSyncAgain: false,
_reSyncAgainTimes: 0,
// notebook // notebook
_syncNotebookIsLastChunk: false, _syncNotebookIsLastChunk: false,
@@ -711,7 +712,8 @@ var Sync = {
// send changes // send changes
callback && callback(); callback && callback();
} else { } else {
console.error('_needIncrSyncAgain callback')
callback && callback();
} }
}); });
@@ -778,6 +780,8 @@ var Sync = {
console.log('inc sync start'); console.log('inc sync start');
if (again) { if (again) {
console.log('again >>'); console.log('again >>');
} else {
me._reSyncAgainTimes = 0
} }
// 得到当前LastSyncUsn // 得到当前LastSyncUsn
@@ -953,7 +957,6 @@ var Sync = {
return; return;
} }
console.error('---?? checkNeedIncSyncAgain ??------' + usn) console.error('---?? checkNeedIncSyncAgain ??------' + usn)
console.trace();
me._needIncrSyncAgain = true; me._needIncrSyncAgain = true;
} }
} }
@@ -1205,8 +1208,9 @@ var Sync = {
me.addSyncProcessStatus(10); me.addSyncProcessStatus(10);
// 重新再来一次增量同步 // 重新再来一次增量同步
if (me._needIncrSyncAgain) { if (me._needIncrSyncAgain && me._reSyncAgainTimes < 5) {
console.error(' needIncrSyncAgain') console.error(' needIncrSyncAgain')
me._reSyncAgainTimes++
me.fixConflictsForSendChanges(function() { me.fixConflictsForSendChanges(function() {
me.incrSync(true); me.incrSync(true);
}); });