From a7fa6f18dc7919b3a441fcea2a35e1c313f89555 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 22 Jan 2024 18:05:41 -0500 Subject: [PATCH] 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'. --- lib/pleroma/migrators/support/base_migrator.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/migrators/support/base_migrator.ex b/lib/pleroma/migrators/support/base_migrator.ex index ce88caac7..76a5d4590 100644 --- a/lib/pleroma/migrators/support/base_migrator.ex +++ b/lib/pleroma/migrators/support/base_migrator.ex @@ -188,10 +188,11 @@ defp update_status(status, message \\ nil) 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