connect-mongostore
connect-mongostore copied to clipboard
Configuring Timeouts
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"}}
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.