【问题标题】:azure sails the hook 'orm' is taking too longazure 帆钩“orm”耗时太长
【发布时间】:2017-07-24 20:53:09
【问题描述】:

我正在关注本指南:

https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-nodejs-sails-cli-nodejs

在“连接到 Azure 中的数据库”部分 第 10 步,我收到错误消息:

Error: The hook 'orm' is taking too long to load. Make sure it is triggering its 'initialize()' callback, or else set 'sails.config.orm._hookTimeout to a higher value (currently 20000)

当我“起航”时出现此错误

我尝试编辑 loadhook.js 文件夹以增加超时。没有运气。

其他步骤都很顺利。 mongo db 在 azure 上运行。我添加了

models: { connection: 'docDbMongo', migrate: 'alter' },

到 development.js 和 production.js,但在 production.js 中,我已经像指南中一样“安全”迁移。

我现在该怎么办?

谢谢,

【问题讨论】:

    标签: node.js mongodb azure sails.js sails-mongo


    【解决方案1】:

    我在名为“Open config/local.js and add the following connections object”的步骤 7 中发现对象 docDbMongo 中缺少属性 port。我认为这引发了您的问题。

    connections: {
        docDbMongo: {
            user: "<database user>",
            password: "<database password>",
            host: "<database hostname>",
            port: "10250", // add this line to config/local.js
            database: "<database name>",
            ssl: true
        },
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-07
      • 2018-02-27
      • 2013-05-28
      • 2014-05-30
      相关资源
      最近更新 更多