Sails-Mongoose ORM override hook自动关闭服务器

时间:2017-01-22 06:59:22

标签: sails.js sails-mongo

我在SailsJS上构建一个应用程序,并使用sails-mongoose hook使用MongoDb。服务器会自动崩溃并关闭,提及下面显示的错误。

我发现它主要发生在我的电脑进入睡眠模式时。我不确定这是否是导致坠机的原因。

有没有办法避免它/调试它?

`initialize` function of Mongoose hook (ORM hook override) was called again,
but that should never happen more than once!
error: Proceeding to crash the server... (this is to avoid creating any weird 
race conditions that could potentially mess up your data)
D:\node\myapp\api\hooks\sails-mongoose\index.js:109

Error: connection timeout
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\lib\drivers\node-mongodb-   native\connection.js:168:17)
   at emitTwo (events.js:87:13)
   at emit (events.js:172:7)
   at listener (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\lib\db.js:1786:14)
   at emitOne (events.js:77:13)
   at emit (events.js:169:7)
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\lib\server.js:267:14)
   at emitOne (events.js:77:13)
   at emit (events.js:169:7)
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:318:12)
   at emitOne (events.js:77:13)
   at emit (events.js:169:7)
   at null.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\connection\pool.js:270:12)
   at g (events.js:260:16)
   at emitTwo (events.js:87:13)
   at emit (events.js:172:7)
   at Socket.<anonymous> (D:\node\myapp\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\lib\connection\connection.js:185:10)
   at Socket.g (events.js:260:16)
   at emitNone (events.js:67:13)
   at Socket.emit (events.js:166:7)
   at Socket._onTimeout (net.js:332:8)
   at _runOnTimeout (timers.js:524:11)
   at _makeTimerTimeout (timers.js:515:3)
   at Timer.unrefTimeout (timers.js:584:5)

0 个答案:

没有答案