Use fully qualified function capture for telementry event

Otherwise we get warnings on startup as local captures
and anonymous functions are supposedly less performant.
This commit is contained in:
Oneric 2024-02-03 17:51:40 +01:00
parent a6df71eebb
commit 18ecae6183

View file

@ -15,8 +15,19 @@ defmodule Pleroma.JobQueueMonitor do
@impl true
def init(state) do
:telemetry.attach("oban-monitor-failure", [:oban, :job, :exception], &handle_event/4, nil)
:telemetry.attach("oban-monitor-success", [:oban, :job, :stop], &handle_event/4, nil)
:telemetry.attach(
"oban-monitor-failure",
[:oban, :job, :exception],
&Pleroma.JobQueueMonitor.handle_event/4,
nil
)
:telemetry.attach(
"oban-monitor-success",
[:oban, :job, :stop],
&Pleroma.JobQueueMonitor.handle_event/4,
nil
)
{:ok, state}
end