Verified Commit 1be14cc4 authored by Alex Gleason's avatar Alex Gleason
Browse files

Ignore runtime deps in Pleroma.Config.Loader with Module.concat/1

Speeds up recompilation
parent 5667c02f
Pipeline #36494 passed with stages
in 11 minutes and 55 seconds
......@@ -3,21 +3,21 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Config.Loader do
defp reject_keys,
do: [
Pleroma.Repo,
Pleroma.Web.Endpoint,
:env,
:configurable_from_database,
:database,
:swarm
]
defp reject_groups,
do: [
:postgrex,
:tesla
]
# These modules are only being used as keys here (for equality check),
# so it's okay to use `Module.concat/1` to have the compiler ignore them.
@reject_keys [
Module.concat(["Pleroma.Repo"]),
Module.concat(["Pleroma.Web.Endpoint"]),
:env,
:configurable_from_database,
:database,
:swarm
]
@reject_groups [
:postgrex,
:tesla
]
if Code.ensure_loaded?(Config.Reader) do
@reader Config.Reader
......@@ -54,7 +54,7 @@ defp filter(configs) do
@spec filter_group(atom(), keyword()) :: keyword()
def filter_group(group, configs) do
Enum.reject(configs[group], fn {key, _v} ->
key in reject_keys() or group in reject_groups() or
key in @reject_keys or group in @reject_groups or
(group == :phoenix and key == :serve_endpoints)
end)
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment