当我试图从小袋和沙发上同步时。沙发因为每次更换都要求从沙袋到沙发而崩溃。
有人可以帮帮我吗?代码:
function _createTestDB() {
$log.debug("_createLocalStorage()");
var deferred = $q.defer();
var promise = deferred.promise;
if (dbInstance) {
_initIndexes(["type"]).then(function success(response) {
dbInstance.sync(remoteDB, {live: true,retry: true , batch_size : 1});
deferred.resolve();
}, function failure(error) {
deferred.reject();
});
} else {
if (ENV.localDbName) {
dbInstance = new PouchDB(ENV.localDbName);
_initIndexes(["type"]).then(function success(response) {
dbInstance.sync(remoteDB, {live: true,retry: true , batch_size : 1});
deferred.resolve();
}, function failure(error) {
deferred.reject();
});
} else {
deferred.reject();
}
}
return promise;
}
谢谢。