PouchDB ETIMEDOUT错误 [英] PouchDB ETIMEDOUT error

查看:193
本文介绍了PouchDB ETIMEDOUT错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我们一直在构建一个使用couchDb / cloudant和Pouchdb作为我们的驱动程序客户端(离子框架)和服务器端(节点)的应用程序。

So we've been building an app that uses couchDb/cloudant with Pouchdb as our driver client side (ionic framework) and server side (node).

我们在连接到遥控器时遇到错误,这似乎是随机出现的,只是暂时重新启动应用程序或打开新浏览器消失。

Of late we've been getting errors when connecting to the remote, that seem to appear at random and only disappear temporarily restarting the app, or opening a new browser.


update-data.service.js:38错误:ETIMEDOUT(...)(匿名函数)@
update-data.service.js:38processQueue @ angular.js:16383(匿名
函数)@ angular.js:16399 $ eval @ angular.js:17682 $ digest @
angular.js:17495(匿名函数)@
angular.js:17721completeOutstandingRequest @ angular.js:5964(匿名)
函数)@ angular.js:6243

update-data.service.js:38 Error: ETIMEDOUT(…)(anonymous function) @ update-data.service.js:38processQueue @ angular.js:16383(anonymous function) @ angular.js:16399$eval @ angular.js:17682$digest @ angular.js:17495(anonymous function) @ angular.js:17721completeOutstandingRequest @ angular.js:5964(anonymous function) @ angular.js:6243

在隐身浏览器中运行虽然暂时删除了问题(或单独的浏览器)但错误总是回来。

When running in incognito browser though temporarily removed the issue (or seperate browser) but the error always comes back.

启动和停止沙发似乎也可以暂时解决问题。

Starting and stopping couch seems to also temporarily solve the problem.

当作为一个人运行时出现问题是不可预测的应用程序(包括android和ios)以cloudant作为后端

Issue comes up unpredictably when running as an app (both android and ios) with cloudant as the backend

还没有在node.js服务器上看到它。

Have not seen it yet on node.js server.

我们可以探索的任何可能的途径或方向?

Any possible avenues or directions that we could explore?

推荐答案

我有这些 ETIMEDOUT 错误,可能是因为互联网连接不良。

I have these ETIMEDOUT errors from PouchDB when the HTTP request to a remote database cannot be done, presumably because of a poor internet connection.

如果有起伏的话您的连接可以尝试在引发超时错误之前增加持续时间(查看远程数据库中的选项doc ):

If there is up and downs in your connection you can try to increase the duration before a timeout error is thrown (see the options for remote databases in the doc):

var remote = new PouchDB('address', {
  ajax: {
    timeout: 60000,
  }
});

在上面的示例中,仅当无法为60执行HTTP请求时才会引发超时错误秒。

In the above example, a timeout error will be thrown only if the HTTP request cannot be done for 60 seconds.

这篇关于PouchDB ETIMEDOUT错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆