Skip to content

Commit

Permalink
fix: Change measures to maps to avoid deprecation warnings (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecabaco authored Feb 21, 2024
1 parent 4ce7ab2 commit 020cff4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions lib/extensions/postgres_cdc_rls/subscriptions_checker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,25 @@ defmodule Extensions.PostgresCdcRls.SubscriptionsChecker do
Enum.reduce(pids, [], fn pid, acc ->
case :ets.lookup(tid, pid) do
[] ->
Telemetry.execute([:realtime, :subscriptions_checker, :pid_not_found], 1, %{
tenant_id: tenant_id
})
Telemetry.execute(
[:realtime, :subscriptions_checker, :pid_not_found],
%{quantity: 1},
%{
tenant_id: tenant_id
}
)

acc

results ->
for {^pid, postgres_id, _ref, _node} <- results do
Telemetry.execute([:realtime, :subscriptions_checker, :phantom_pid_detected], 1, %{
tenant_id: tenant_id
})
Telemetry.execute(
[:realtime, :subscriptions_checker, :phantom_pid_detected],
%{quantity: 1},
%{
tenant_id: tenant_id
}
)

:ets.delete(tid, pid)
UUID.string_to_binary!(postgres_id)
Expand Down
2 changes: 1 addition & 1 deletion lib/realtime/telemetry/telemetry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Realtime.Telemetry do
Dispatches Telemetry events.
"""

@spec execute([atom, ...], number | map, map) :: :ok
@spec execute([atom, ...], map, map) :: :ok
def execute(event, measurements, metadata \\ %{}) do
:telemetry.execute(event, measurements, metadata)
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.25.64",
version: "2.25.65",
elixir: "~> 1.14.0",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit 020cff4

Please sign in to comment.