Pleroma.Migrators.Support.BaseMigrator: Fix dialyzer errors

lib/pleroma/migrators/context_objects_deletion_migrator.ex:13:exact_eq
The test :error | float() == 0 can never evaluate to 'true'.

lib/pleroma/migrators/hashtags_table_migrator.ex:13:exact_eq
The test :error | float() == 0 can never evaluate to 'true'.
This commit is contained in:
Mark Felder 2024-01-22 18:05:41 -05:00
parent 6ce7011a2e
commit a7fa6f18dc

View File

@ -188,10 +188,11 @@ defmodule Pleroma.Migrators.Support.BaseMigrator do
end
defp fault_rate do
with failures_count when is_integer(failures_count) <- failures_count() do
with failures_count when is_integer(failures_count) <- failures_count(),
true <- failures_count > 0 do
failures_count / Enum.max([get_stat(:affected_count, 0), 1])
else
_ -> :error
_ -> 0
end
end