1
0
Fork 0
forked from mirrors/akkoma
akkoma/lib/pleroma/workers/nodeinfo_fetcher_worker.ex
floatingghost b7e8ce2350 Scrape instance nodeinfo (#251)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/251
2022-11-06 22:49:39 +00:00

19 lines
391 B
Elixir

defmodule Pleroma.Workers.NodeInfoFetcherWorker do
use Pleroma.Workers.WorkerHelper, queue: "nodeinfo_fetcher"
alias Oban.Job
alias Pleroma.Instances.Instance
@impl Oban.Worker
def perform(%Job{
args: %{"op" => "process", "source_url" => domain}
}) do
uri =
domain
|> URI.parse()
|> URI.merge("/")
Instance.update_metadata(uri)
end
end