【问题标题】:Azure node increasing connection timeoutAzure 节点增加连接超时
【发布时间】:2018-04-17 05:09:54
【问题描述】:

我有一个使用 azure/node 构建的移动应用后端,但我似乎不知道如何增加我的 SQL 数据库连接超时。看起来默认值为 15 秒,我想将其增加到 30。具体来说,连接到数据库的代码如下(使用 azure-mobile-apps 节点包)。谢谢!

var azureMobileApps = require('azure-mobile-apps');

var app = express();
var mobileApp = azureMobileApps({
    homePage: true,
    swagger: true
});

mobileApp.tables.import('./tables');
mobileApp.api.import('./api');

//This times out after 15 seconds and I want to change it to 30.
mobileApp.tables.initialize()
    .then(function () {
        app.use(mobileApp);
        app.listen(process.env.PORT || 3000);
    });

【问题讨论】:

    标签: node.js azure azure-sql-database azure-mobile-services


    【解决方案1】:

    您需要通过在Azure portal 中添加;Connection Timeout=30 来更改连接字符串。默认为 15,以秒为单位。

    【讨论】:

      【解决方案2】:

      要增加请求的超时时间,您可以尝试将其放入您的 app.js 文件中。

      var mobileApp = azureMobileApps({
          homePage: true,
          data: {
              requestTimeout: 60000
          }
      });
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-08-15
        • 2018-12-08
        • 2013-04-08
        • 2016-05-08
        • 1970-01-01
        • 2014-04-16
        • 1970-01-01
        • 2015-06-04
        相关资源
        最近更新 更多