gpt4 book ai didi

javascript - pouchdb 已停止同步且没有错误

转载 作者:行者123 更新时间:2023-11-30 00:01:36 28 4
gpt4 key购买 nike

我正在使用这个同步代码,它确实有效,但现在没有同步,没有错误。

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

控制台中没有错误,包括没有同步指示。

我的谷歌搜索没有找到类似的东西。

任何想法都会很棒。

最佳答案

我发现了我的问题。我在玩离线功能,没有清除缓存。缓存中有 upup.sw.min.js 文件,似乎把所有东西都搞砸了。清除该地址的缓存后,我的同步工作正常。

感谢 Mike 插入我看得更远。

关于javascript - pouchdb 已停止同步且没有错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40249033/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com