aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-07-17 17:14:08 +0000
committerAriadne Conill <ariadne@dereferenced.org>2019-07-17 17:14:08 +0000
commitd930e5d5c322a7c4b3a080dfa3e318d97994aaf1 (patch)
tree274fb3bb226f22d7dc8842d45d68c7558c5072a1 /lib
parent62e5ff624e1984b48eecaf2a6c14ad092013a13e (diff)
downloadpleroma-d930e5d5c322a7c4b3a080dfa3e318d97994aaf1.tar.gz
activitypub: introduce internal fetch service actor
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/application.ex5
-rw-r--r--lib/pleroma/web/activity_pub/internal_fetch_actor.ex20
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex
index ba4cf8486..035331491 100644
--- a/lib/pleroma/application.ex
+++ b/lib/pleroma/application.ex
@@ -140,6 +140,11 @@ defmodule Pleroma.Application do
id: :federator_init,
start: {Task, :start_link, [&Pleroma.Web.Federator.init/0]},
restart: :temporary
+ },
+ %{
+ id: :internal_fetch_init,
+ start: {Task, :start_link, [&Pleroma.Web.ActivityPub.InternalFetchActor.init/0]},
+ restart: :temporary
}
] ++
streamer_child() ++
diff --git a/lib/pleroma/web/activity_pub/internal_fetch_actor.ex b/lib/pleroma/web/activity_pub/internal_fetch_actor.ex
new file mode 100644
index 000000000..9213ddde7
--- /dev/null
+++ b/lib/pleroma/web/activity_pub/internal_fetch_actor.ex
@@ -0,0 +1,20 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.InternalFetchActor do
+ alias Pleroma.User
+
+ require Logger
+
+ def init do
+ # Wait for everything to settle.
+ Process.sleep(1000 * 5)
+ get_actor()
+ end
+
+ def get_actor do
+ "#{Pleroma.Web.Endpoint.url()}/internal/fetch"
+ |> User.get_or_create_service_actor_by_ap_id("internal.fetch")
+ end
+end