node.js - Azure Node 增加连接超时

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

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

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);
    });

最佳答案

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

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

关于node.js - Azure Node 增加连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47113213/

相关文章:

reactjs - Azure 应用服务部署 REACT JS 应用程序时出现错误

asp.net-mvc - Mvc azure存储,一定时间后自动删除存储

sql - Azure SQL 数据库备份菜单不可用

SQL Azure 无法识别我的聚集索引

SQL Azure - 与本地主机数据库相比非常慢

node.js - Firebase 部署云功能突然不起作用了

node.js - 为什么 Angular 8 推荐 Node 12?

javascript - 使用用户帐户登录 MongoDB

node.js - 如何使用 redis 适配器覆盖套接字的基本适配器?

azure - 如何使用Windows Azure管理客户端停止和启动Azure云服务