From: lain Date: Mon, 21 Dec 2020 11:03:58 +0000 (+0100) Subject: Cachex: Unify arity of callback function X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c9d73af74dc816dac484f1be2e842baac6fdaa6c;p=akkoma Cachex: Unify arity of callback function --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 6c1b77d9f..26a9572a4 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1091,7 +1091,7 @@ defmodule Pleroma.User do def get_cached_by_nickname(nickname) do key = "nickname:#{nickname}" - @cachex.fetch!(:user_cache, key, fn -> + @cachex.fetch!(:user_cache, key, fn _ -> case get_or_fetch_by_nickname(nickname) do {:ok, user} -> {:commit, user} {:error, _error} -> {:ignore, nil} diff --git a/lib/pleroma/web/mastodon_api/controllers/poll_controller.ex b/lib/pleroma/web/mastodon_api/controllers/poll_controller.ex index 42f263c8c..e26ec7136 100644 --- a/lib/pleroma/web/mastodon_api/controllers/poll_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/poll_controller.ex @@ -57,7 +57,7 @@ defmodule Pleroma.Web.MastodonAPI.PollController do defp get_cached_vote_or_vote(user, object, choices) do idempotency_key = "polls:#{user.id}:#{object.data["id"]}" - @cachex.fetch!(:idempotency_cache, idempotency_key, fn -> + @cachex.fetch!(:idempotency_cache, idempotency_key, fn _ -> case CommonAPI.vote(user, object, choices) do {:error, _message} = res -> {:ignore, res} res -> {:commit, res}