1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-28 10:52:11 +00:00
mobilizon/lib/service/workers/clean_suspended_actors.ex
Thomas Citharel b79f918d51
Correct a @moduledoc
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-04-20 19:15:33 +02:00

18 lines
481 B
Elixir

defmodule Mobilizon.Service.Workers.CleanSuspendedActors do
@moduledoc """
Worker to clean suspended actors
"""
use Oban.Worker, queue: "background"
alias Mobilizon.Actors
alias Mobilizon.Service.ActorSuspension
@suspention_days 30
@impl Oban.Worker
def perform(%Job{}) do
[suspension: @suspention_days]
|> Actors.list_suspended_actors_to_purge()
|> Enum.each(&ActorSuspension.suspend_actor(&1, reserve_username: true, suspension: true))
end
end