New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow TypeormStore to recover from failed request #19
Comments
Hello! I like how "Give the users a way to define a failure handler" sounds. What do you think of an option like |
…ecover from failed request
I like I added a (quick and dirty) failing test case in #20 |
Hello again, sorry for the delay, have been busy over the week. onError keeps the debug line but is called right after it instead of the disconnect event if present. Please confirm that the commit dd5516e works for your case so I publish the patch to npm, or reopen the issue if it doesn't. |
Yep that works great, thanks ! |
Hey there 👋
First, thanks for the lib !
We had an issue in prod the other day ; our (Postgres) database threw an exception at some point while fetching the sessions. However it was just a flake, not a complete crash of the connection. When this happens, the
TypeormStore
emits adisconnect
event, and then never reconnects. We did a quickfix but that's nasty (see below).I don't think the store should disconnect on every time there's an exception. Not sure what the ideal behavior would be:
connect
/disconnect
events, see Redis: https://github.com/tj/connect-redis/Any thoughts ?
For reference, our quickfix is to do something like:
Note: The timeout is to give the
disconnect
event more time to propagate before we fire aconnect
event, I think even a 0 timeout would work.The text was updated successfully, but these errors were encountered: