Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSetting time zone on reconnect #582
Comments
This comment has been minimized.
|
This is probably a question to ask on the r2d2 repo, but it looks like you can set a connection customizer in the pool's configuration. http://sfackler.github.io/r2d2/doc/v0.7.1/r2d2/config/struct.Builder.html#method.connection_customizer |
sgrif
closed this
Feb 2, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Boscop commentedJan 19, 2017
I use this code for my postgres connection:
And when my server starts, I do this to set the time zone to UTC, because I want to store all times as UTC in a timestamp type (without timezone):
(Times are converted to the user's time zone to relative times using moment.js on the frontend. Until then, they stay in UTC.)
Since timezone is a per session setting, my question is, what if the connection between postgres and my web server breaks down (e.g. postgres is restarted).
How can I get notified via the ConnectionManager and set the time zone to UTC again? (Since it's a new session and the timezone will be reset to the local time zone.)