logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

delete_worker.ex (651B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Workers.DeleteWorker do
  5. alias Pleroma.Instances.Instance
  6. alias Pleroma.User
  7. use Oban.Worker, queue: :slow
  8. @impl true
  9. def perform(%Job{args: %{"op" => "delete_user", "user_id" => user_id}}) do
  10. user = User.get_cached_by_id(user_id)
  11. User.perform(:delete, user)
  12. end
  13. def perform(%Job{args: %{"op" => "delete_instance", "host" => host}}) do
  14. Instance.perform(:delete_instance, host)
  15. end
  16. @impl true
  17. def timeout(_job), do: :timer.seconds(900)
  18. end