The ap_id is a URL, so we can just pass that to set_reachable/1
Also only bother attempting to mark reachable if it was known to be unreachable
This commit is contained in:
parent
b87ec49972
commit
0f667761a9
1 changed files with 3 additions and 7 deletions
|
|
@ -12,13 +12,9 @@ defmodule Pleroma.Workers.RemoteFetcherWorker do
|
|||
def perform(%Job{args: %{"op" => "fetch_remote", "id" => id} = args}) do
|
||||
case Fetcher.fetch_object_from_id(id, depth: args["depth"]) do
|
||||
{:ok, _object} ->
|
||||
# Mark the server as reachable since we successfully fetched an object
|
||||
case URI.parse(id) do
|
||||
%URI{host: host} when not is_nil(host) ->
|
||||
Instances.set_reachable("https://#{host}")
|
||||
|
||||
_ ->
|
||||
:ok
|
||||
unless Instances.reachable?(id) do
|
||||
# Mark the server as reachable since we successfully fetched an object
|
||||
Instances.set_reachable(id)
|
||||
end
|
||||
|
||||
:ok
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue