node.js - Odd "timeouts" when attempting to execute a MongoDB query from a Sails.js app -


when start sails application in localhost environment , load in browser, view render fine, async request (non-mongo) resource works fine, async requests sails fetch data mongo works within first few moments of app start.

i can hammer many requests want long 1 request in in first few moments. beyond that, if wait full 2 or 3 seconds, call stall.

here's example of query using native:

    item.native(function (error, collection) {       collection.find().sort({'count': 1}).limit(parseint(count)).toarray(function(error, data) {         console.log(error, data);         return res.send(data);       });     }); 

and example using waterline:

item.find().sort('count asc').limit(count).exec(function (error, data) {   console.log(error, data);   return res.send(data); }); 

when stalls, callback never called, no error ever gets logged console.

i've tried stepping through code , and seems flow of logic bounces around internal _dispatch() function, couple of bind functions , , forth , on , on.

i can verify queries work fine mongo console, , i'm seeding database using waterline on app start , that's working fine. can access collection fine (the first callback using native executes). feel i'm starting run out of ideas, great. taking look.

here's i'm running reference:

  • sails: 0.11.0
  • mongo: 2.6.10
  • sails-mongo: 0.11.0

gconsidine, sails-mongo v0.11.0 , v0.11.1 have bad connection configs. check answer on previous thread: https://stackoverflow.com/a/29973775/4249576. try updating sails-mongo v0.11.2.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -