X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Foauth%2Ftoken%2Fclean_worker.ex;h=e3aa4eb7e539a2e4b097eb8db6830793de5389f9;hb=527afb813af6c64337d02ddf1a2f159fe557acbc;hp=3c9c580d51f1870ed5810709fe477f7f0726faea;hpb=e4ea0e20b32152a7f7497c2ec8ebbe5c71b3db47;p=akkoma diff --git a/lib/pleroma/web/oauth/token/clean_worker.ex b/lib/pleroma/web/oauth/token/clean_worker.ex index 3c9c580d5..e3aa4eb7e 100644 --- a/lib/pleroma/web/oauth/token/clean_worker.ex +++ b/lib/pleroma/web/oauth/token/clean_worker.ex @@ -1,17 +1,18 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.Token.CleanWorker do @moduledoc """ - The module represents functions to clean an expired oauth tokens. + The module represents functions to clean an expired OAuth and MFA tokens. """ use GenServer @ten_seconds 10_000 @one_day 86_400_000 - alias Pleroma.Web.OAuth.Token + alias Pleroma.MFA + alias Pleroma.Web.OAuth alias Pleroma.Workers.BackgroundWorker def start_link(_), do: GenServer.start_link(__MODULE__, %{}) @@ -30,5 +31,8 @@ defmodule Pleroma.Web.OAuth.Token.CleanWorker do {:noreply, state} end - def perform(:clean), do: Token.delete_expired_tokens() + def perform(:clean) do + OAuth.Token.delete_expired_tokens() + MFA.Token.delete_expired_tokens() + end end