Skip to content

Commit

Permalink
Adding spec
Browse files Browse the repository at this point in the history
  • Loading branch information
akoutmos committed Aug 9, 2024
1 parent 3feeceb commit c684a3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/prom_ex/metric_types/polling.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ defmodule PromEx.MetricTypes.Polling do
end

@doc false
@spec safe_polling_runner(mfa :: mfa()) :: :ok | :error
def safe_polling_runner({module, function, args} = mfa) do
apply(module, function, args)
:ok
rescue
error ->
Logger.warning("MFA #{inspect(mfa)} encountered an error but has not been detached: #{inspect(error)}")
:error
end
end

0 comments on commit c684a3f

Please sign in to comment.