【发布时间】:2017-03-08 00:54:36
【问题描述】:
我正在使用这个同步代码,它确实有效,但现在没有同步,没有错误。
this.sync = function(remoteDatabase) {
database.sync(remoteDatabase, {live: true, retry: true})
.on('complete', function (changes) {
// yay, we're in sync!
console.log("sync complete");
}).on('change', function (change) {
// yo, something changed!
console.log("sync change");
}).on('paused', function (info) {
// replication was paused, usually because of a lost connection
console.log("sync pause");
}).on('active', function (info) {
// replication was resumed
console.log("sync active");
}).on('error', function (err) {
// boo, we hit an error!
console.log("sync error");
alert("data was not replicated to server, error - " + err);
});
console.log("end of sync function");
};
我的开发控制台显示:
end of sync Function
大约 10 秒后控制台显示:
sync paused
sync paused
控制台中没有错误,包括没有同步的迹象。
我的谷歌搜索没有找到类似的东西。
任何想法都会很棒。
【问题讨论】:
-
你已经得到了答案,不是吗?它将显示
sync pause“通常是因为连接丢失”。您现在可能无法连接到远程数据库。这可能很简单,因为路由器已关闭以在数据库端发生全面的灾难性爆炸。从这里说不出来。 -
我在连接到网络服务器的桌面上。它失去连接的原因可能是什么?
-
就像我说的,很多。计算机死了,有人从网络上拔下服务器,它正在重新启动,你的防火墙阻止它,服务器防火墙阻止你,等等等等。
-
感谢您提供的信息,我已经重新启动了 couchbase 的同步网关,但在我的开发控制台上出现错误。我会进一步研究。再次感谢
-
mike,你熟悉 Couchbase 同步网关吗?我想知道我的配置文件“configServer”是否应该与我在 puochdb 中的同步数据库匹配?
标签: javascript angularjs pouchdb