Skip to content

fix: add auto_reconnect to the Postgrex.Notifications #24

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

Closed
wants to merge 2 commits into from

Conversation

abc3
Copy link

@abc3 abc3 commented May 26, 2025

If Postgres is not available at the time of startup, Postgrex.Notifications.start_link will kill the strategy process each time the supervisor restarts it, until all retries are exhausted.

{:ok, conn_notif} <- Postgrex.Notifications.start_link(state.meta.opts.()),

This PR fixes this behavior by starting Postgrex.Notifications with the :auto_reconnect option. This prevents the process from killing and allows it to keep retrying connection attempts in the background. Once Postgres becomes available again, the process will cast the node name into the cluster.

@abc3
Copy link
Author

abc3 commented May 26, 2025

cc @Ziinc @filipecabaco

@abc3
Copy link
Author

abc3 commented May 26, 2025

ah, auto_reconnect is already been added in #20

@abc3 abc3 closed this May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant