Switch to runtime deps in ActivityPub.SideEffects
authorAlex Gleason <alex@alexgleason.me>
Tue, 8 Jun 2021 23:18:25 +0000 (18:18 -0500)
committerAlex Gleason <alex@alexgleason.me>
Tue, 8 Jun 2021 23:18:25 +0000 (18:18 -0500)
Speeds up recompilation by reducing compile cycles

lib/pleroma/web/activity_pub/side_effects.ex

index 674356d9a8a09e2df08d38541fa59c5bff70d7e8..1eca1cb3179c975ff656d36ac549f36640dfcc74 100644 (file)
@@ -28,11 +28,12 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
   require Logger
 
   @cachex Pleroma.Config.get([:cachex, :provider], Cachex)
-  @ap_streamer Pleroma.Config.get([:side_effects, :ap_streamer], ActivityPub)
   @logger Pleroma.Config.get([:side_effects, :logger], Logger)
 
   @behaviour Pleroma.Web.ActivityPub.SideEffects.Handling
 
+  defp ap_streamer, do: Pleroma.Config.get([:side_effects, :ap_streamer], ActivityPub)
+
   @impl true
   def handle(object, meta \\ [])
 
@@ -302,8 +303,8 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
 
             MessageReference.delete_for_object(deleted_object)
 
-            @ap_streamer.stream_out(object)
-            @ap_streamer.stream_out_participations(deleted_object, user)
+            ap_streamer().stream_out(object)
+            ap_streamer().stream_out_participations(deleted_object, user)
             :ok
           else
             {:actor, _} ->