D. Cantatore
D. Cantatore

Reputation: 187

Meteor Method/Call Timed Out after 30 seconds

I am running into an issue with a very complex aggregate on a slow database setup that I have running.

Sometimes if it is complex enough it takes over 30 seconds, and I get:

Exception while invoking method 'methodName' MongoError: connection 3 to 'IP.IP.IP.IP' timed out
 at Object.Future.wait

I know that it's not great to have something that takes over 30 seconds but that's what I'm working with. Is there any way to set the meteor call to wait for longer than 30 seconds before timing out?

Upvotes: 0

Views: 141

Answers (1)

D. Cantatore
D. Cantatore

Reputation: 187

I found the answer to this after digging in the problem a bit more. In my connection to my meteor app when I specify the url I needed to add a this to my mongo url:

socketTimeoutMS=XXXXX

My url now looks like:

MONGO_URL=mongodb://localhost:27017/dbName?socketTimeoutMS=45000 meteor 

This thread got me in the right direction: "Server x timed out" during MongoDB aggregation

I had also tried .noCursorTimeout() at the end of my aggregate on guess, that did nothing.

Upvotes: 1

Related Questions