Skip to content

Commit

Permalink
dialyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
savhappy committed Oct 21, 2024
1 parent adc99cf commit 3a28a27
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions lib/sentry/client_report/sender.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,27 @@ defmodule Sentry.ClientReport.Sender do

@impl true
def handle_info(:send_report, state) do
if map_size(state) != 0 and Config.dsn() != nil and Config.send_client_reports?() do
client_report =
%ClientReport{
timestamp:
DateTime.utc_now()
|> DateTime.truncate(:second)
|> DateTime.to_iso8601()
|> String.trim_trailing("Z"),
discarded_events:
Enum.map(state, fn {{reason, category}, quantity} ->
%{
reason: reason,
category: category,
quantity: quantity
}
end)
}
_ =
if map_size(state) != 0 and Config.dsn() != nil and Config.send_client_reports?() do
client_report =
%ClientReport{
timestamp:
DateTime.utc_now()
|> DateTime.truncate(:second)
|> DateTime.to_iso8601()
|> String.trim_trailing("Z"),
discarded_events:
Enum.map(state, fn {{reason, category}, quantity} ->
%{
reason: reason,
category: category,
quantity: quantity
}
end)
}

Client.send_client_report(client_report)
end
Client.send_client_report(client_report)
end

schedule_report()
{:noreply, %{}}
Expand Down

0 comments on commit 3a28a27

Please sign in to comment.