logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: a7fa6f18dc7919b3a441fcea2a35e1c313f89555
parent 6ce7011a2e07d9e8e7d7fdc1a6fe340bac6e1404
Author: Mark Felder <feld@feld.me>
Date:   Mon, 22 Jan 2024 18:05:41 -0500

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'.

Diffstat:

Mlib/pleroma/migrators/support/base_migrator.ex5+++--
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 @@ -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