Make sure everything is synced before migrating the drive

pull/1/head
yflory 8 years ago
parent 7dd9ed543a
commit 969cec5d60

@ -793,8 +793,7 @@ define([
try {
debug("Migrating file system...");
files.migrate = 1;
if (exp.rt) { exp.rt.sync(); }
window.setTimeout(function () {
var next = function () {
var oldData = files[OLD_FILES_DATA].slice();
if (!files[FILES_DATA]) {
files[FILES_DATA] = {};
@ -838,7 +837,13 @@ define([
delete files.migrate;
console.log('done');
todo();
}, 300);
};
if (exp.rt) {
exp.rt.sync();
Cryptpad.whenRealtimeSyncs(exp.rt, next);
} else {
window.setTimeout(next, 1000);
}
} catch(e) {
console.error(e);
todo();

Loading…
Cancel
Save