For my keystonejs project I have created two docker containers (one for mongo, one for the keystonejs app). All works well, with the exception that I am getting very often a "connection closed" error when browsing the site (usually when I haven't navigated for a couple of minutes). The full error stack is below:
Error thrown for request: /blog
Error: connection closed
at null.<anonymous> (/usr/src/app/node_modules/keystone/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:618:45)
at emitNone (events.js:67:13)
at emit (events.js:166:7)
at null.<anonymous> (/usr/src/app/node_modules/keystone/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:171:15)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/usr/src/app/node_modules/keystone/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:550:12)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at TCP._onclose (net.js:477:12)
I have done some investigation, and another post on stackoverflow suggest to use the keepAlive option on mongoose (mongoose output the error "Error: connection closed"). However, I have no idea how I can use these options in keystonejs. Can anybody help?
Best regards, Tom