Skip to content

Commit

Permalink
fix: Improve error handling on realtime channel (#1234)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecabaco authored Nov 25, 2024
1 parent 18dfc46 commit 0aed575
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/realtime_web/channels/realtime_channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ defmodule RealtimeWeb.RealtimeChannel do
nil ->
Logger.warning("Re-connecting to PostgreSQL with params: " <> inspect(pg_change_params))
{:noreply, assign(socket, :pg_sub_ref, postgres_subscribe())}

error ->
log_error("UnableToSubscribeToPostgres", error)
push_system_message("postgres_changes", socket, "error", error, channel_name)
{:noreply, assign(socket, :pg_sub_ref, postgres_subscribe(5, 10))}
end
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Realtime.MixProject do
def project do
[
app: :realtime,
version: "2.33.56",
version: "2.33.57",
elixir: "~> 1.17.3",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit 0aed575

Please sign in to comment.