the hook orm taking too long to load

前端 未结 8 1790
悲&欢浪女
悲&欢浪女 2020-12-05 14:17

i am using two database adapters with sails.

one for mondoDB and second for mysql.whenever i run command \"sails lift\".once it gives an error

error         


        
8条回答
  •  离开以前
    2020-12-05 14:52

    I ran into this problem last night because of a slow internet connection between my laptop and the DB server. My solution was to create a new file in the config directory called orm.js (name doesn't really matter).

    Then add the following code:

    // config/orm.js
    module.exports.orm = {
      _hookTimeout: 60000 // I used 60 seconds as my new timeout
    };
    

    I also found I had to change my pubsub timeout but that may not be necessary for you.

    // config/pubsub.js
    module.exports.pubsub = {
      _hookTimeout: 60000 // I used 60 seconds as my new timeout
    };
    

    Note: The other answer recommends changing the sails files inside the node_modules folder. This is almost always a bad idea because any npm update could revert your changes.

提交回复
热议问题