google-chrome – PouchDB Replication在复制时抛出错误

当我尝试使用我的本地pouchdb复制远程couchdb(在ubuntu 14.04-64位上)时,我遇到了这个奇怪的错误.
我的couchdb通过nginx代理并在https上运行.从客户端到nginx的流量是ssl,而nginx到couchdb是简单的http.在couchdb中启用了Cors请求. Nginx配置与 couchdb recommended最相似.从数据库同步工作正常,但在通过chrome版本54.0.2840.100(64位)进行调试时遇到错误.

enter image description here

以下是错误的完整堆栈跟踪.

raven.min.js:2错误:获取文档时出现问题.
    在finishBatch(http:// localhost:8100 / lib / pouchdb / dist / pouchdb.js:6410:13)
    at processQueue(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:27879:28)
    在http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:27895:27
    在Scope.$eval(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:29158:28)
    在Scope.$digest(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:28969:31)
    在http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:29197:26
    at completeOutstandingRequest(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:18706:10)
    在http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:18978:7
    at d(http:// localhost:8100 / lib / raven-js / dist / raven.min.js:2:4308)undefineda.(匿名函数)@ raven.min.js:2(匿名函数)@ ionic. bundle.js:25642(匿名函数)@ ionic.bundle.js:22421(匿名函数)@ angular.min.js:2processQueue @ ionic.bundle.js:27887(匿名函数)@ ionic.bundle.js:27895 $eval @ ionic.bundle.js:29158 $digest @ ionic.bundle.js:28969(匿名函数)@ ionic.bundle.js:29197completeOutstandingRequest @ ionic.bundle.js:18706(匿名函数)@ ionic.bundle.js: 18978d @ raven.min.js:2
raven.min.js:2在lessondb复制中暂停错误:获取文档时出现问题.
    在finishBatch(http:// localhost:8100 / lib / pouchdb / dist / pouchdb.js:6410:13)
    at processQueue(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:27879:28)
    在http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:27895:27
    在Scope.$eval(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:29158:28)
    在Scope.$digest(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:28969:31)
    在http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:29197:26
    at completeOutstandingRequest(http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:18706:10)
    在http:// localhost:8100 / lib / ionic / js / ionic.bundle.js:18978:7
    在d(http:// localhost:8100 / lib / raven-js / dist / raven.min.js:2:4308)

网络登录chrome显示某些请求被取消

enter image description here

我正在使用couchdb版本 – 1.6.1和pouchdb版本 – 5.3.2.
我使用以下命令来复制dbs:

myDB.replicate.from(remote_db_url,{
      活着:真的,
      重试:是的,
      心跳:假
    })

如果有人可以对心跳参数有所了解,那也很棒.

最佳答案
注意:我无法解决您描述的错误.也许完整的堆栈跟踪而不是截图可能会有所帮助……

但我会尝试对心跳参数有所了解:阅读docs已经有所帮助了.请参阅复制方法的高级选项:

options.heartbeat: Configure the heartbeat supported by CouchDB which keeps the change connection alive.

那么让我们看看CouchDB’s docs来看看这个参数的作用:

Networks are a tricky beast,and sometimes you don’t know whether there are no changes coming or your network connection went stale. If you add another query parameter,heartbeat=N,where N is a number,CouchDB will send you a newline character each N milliseconds. As long as you are receiving newline characters,you know there are no new change notifications,but CouchDB is still ready to send you the next one when it occurs.

所以基本上它似乎是一个轮询机制,每隔n毫秒(其中n是你指定的心跳值)发送一条消息(例如换行符),以确保两个数据库之间的连接仍然有效.

将值设置为false将禁用此机制.

关于哪个值可用于此参数:
PouchDB docs进一步声明,change方法具有类似的参数,如下所示:

options.heartbeat: For http adapter only,time in milliseconds for server to give a heartbeat to keep long connections open. Defaults to 10000 (10 seconds),use false to disable the default.

相关文章

文章浏览阅读3.7k次,点赞2次,收藏5次。Nginx学习笔记一、N...
文章浏览阅读1.7w次,点赞14次,收藏61次。我们在使用容器的...
文章浏览阅读1.4k次。当用户在访问网站的过程中遇到404错误时...
文章浏览阅读2.7k次。docker 和 docker-compose 部署 nginx+...
文章浏览阅读1.3k次。5:再次启动nginx,可以正常启动,可以...
文章浏览阅读3.1w次,点赞105次,收藏182次。高性能:Nginx ...