Pleroma.Object: dialyzer error
lib/pleroma/object.ex:245:call The function call will not succeed. Pleroma.Object.cleanup_attachments(any(), %{<<_::48>> => %Pleroma.Object{:data => map(), atom() => _}}) breaks the contract (boolean(), %{:object => map()}) :: {:ok, Oban.Job.t() | nil}
This commit is contained in:
parent
2062e126f1
commit
948d5a93a0
|
@ -242,17 +242,17 @@ def delete(%Object{data: %{"id" => id}} = object) do
|
|||
{:ok, _} <- invalid_object_cache(object) do
|
||||
cleanup_attachments(
|
||||
Config.get([:instance, :cleanup_attachments]),
|
||||
%{"object" => object}
|
||||
object
|
||||
)
|
||||
|
||||
{:ok, object, deleted_activity}
|
||||
end
|
||||
end
|
||||
|
||||
@spec cleanup_attachments(boolean(), %{required(:object) => map()}) ::
|
||||
@spec cleanup_attachments(boolean(), Object.t()) ::
|
||||
{:ok, Oban.Job.t() | nil}
|
||||
def cleanup_attachments(true, %{"object" => _} = params) do
|
||||
AttachmentsCleanupWorker.enqueue("cleanup_attachments", params)
|
||||
def cleanup_attachments(true, %Object{} = object) do
|
||||
AttachmentsCleanupWorker.enqueue("cleanup_attachments", %{"object" => object})
|
||||
end
|
||||
|
||||
def cleanup_attachments(_, _), do: {:ok, nil}
|
||||
|
|
Loading…
Reference in New Issue