connect-mongostore icon indicating copy to clipboard operation
connect-mongostore copied to clipboard

Configuring Timeouts

Open rickwaugh1 opened this issue 10 years ago • 1 comments

I'm trying to see what will happen when the database server goes away. I have configured the socketOptions with timeout for various numbers. I have set it to 10, and 10,000, and I have rebooted my Mongo servers. It sits for longer than 10 seconds, quite a bit longer. Any idea on why this would be so, and what I would need to do to get it to timeout? I'm hoping this never happens, but I'd like to be prepared.

This is what I have now:

"options":{"autoReconnect":true,"socketOptions":{"connectTimeoutMS":10000,"socketTimeoutMS":10000,"keepAlive":1,"encoding":"utf8"}}

rickwaugh1 avatar Dec 03 '13 22:12 rickwaugh1

I suppose that your problem is caused by using native MongoDB TTL collection feature in this module (it's look very similar to connect-mongo excluding replica sets support), which check for old documents for every 60 seconds - try set your session to 60 seconds and check if you're logged out after one minute.

setthase avatar Jan 13 '14 13:01 setthase