mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-18 17:52:17 +00:00
reSync
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
10
src/sync.js
10
src/sync.js
@@ -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);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user