mobilizon.chapril.org-mobil.../lib/service/workers/background.ex
2020-02-14 18:21:18 +01:00

24 lines
632 B
Elixir

defmodule Mobilizon.Service.Workers.Background do
@moduledoc """
Worker to build search results
"""
alias Mobilizon.Actors
alias Mobilizon.Actors.Actor
use Mobilizon.Service.Workers.Helper, queue: "background"
@impl Oban.Worker
def perform(%{"op" => "delete_actor", "actor_id" => actor_id}, _job) do
with %Actor{} = actor <- Actors.get_actor(actor_id) do
Actors.perform(:delete_actor, actor)
end
end
def perform(%{"op" => "actor_key_rotation", "actor_id" => actor_id}, _job) do
with %Actor{} = actor <- Actors.get_actor(actor_id) do
Actors.actor_key_rotation(actor)
end
end
end