+ def load_custom_modules do
+ dir = Pleroma.Config.get([:modules, :runtime_dir])
+
+ if dir && File.exists?(dir) do
+ dir
+ |> Pleroma.Utils.compile_dir()
+ |> case do
+ {:error, _errors, _warnings} ->
+ raise "Invalid custom modules"
+
+ {:ok, modules, _warnings} ->
+ if @env != :test do
+ Enum.each(modules, fn mod ->
+ Logger.info("Custom module loaded: #{inspect(mod)}")
+ end)
+ end
+
+ :ok
+ end
+ end
+ end
+