Ignore runtime deps in Pleroma.Config.Loader with Module.concat/1
Speeds up recompilation
This commit is contained in:
parent
5667c02fce
commit
1be14cc45f
1 changed files with 15 additions and 15 deletions
|
@ -3,21 +3,21 @@
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Config.Loader do
|
defmodule Pleroma.Config.Loader do
|
||||||
defp reject_keys,
|
# These modules are only being used as keys here (for equality check),
|
||||||
do: [
|
# so it's okay to use `Module.concat/1` to have the compiler ignore them.
|
||||||
Pleroma.Repo,
|
@reject_keys [
|
||||||
Pleroma.Web.Endpoint,
|
Module.concat(["Pleroma.Repo"]),
|
||||||
:env,
|
Module.concat(["Pleroma.Web.Endpoint"]),
|
||||||
:configurable_from_database,
|
:env,
|
||||||
:database,
|
:configurable_from_database,
|
||||||
:swarm
|
:database,
|
||||||
]
|
:swarm
|
||||||
|
]
|
||||||
|
|
||||||
defp reject_groups,
|
@reject_groups [
|
||||||
do: [
|
:postgrex,
|
||||||
:postgrex,
|
:tesla
|
||||||
:tesla
|
]
|
||||||
]
|
|
||||||
|
|
||||||
if Code.ensure_loaded?(Config.Reader) do
|
if Code.ensure_loaded?(Config.Reader) do
|
||||||
@reader Config.Reader
|
@reader Config.Reader
|
||||||
|
@ -54,7 +54,7 @@ defmodule Pleroma.Config.Loader do
|
||||||
@spec filter_group(atom(), keyword()) :: keyword()
|
@spec filter_group(atom(), keyword()) :: keyword()
|
||||||
def filter_group(group, configs) do
|
def filter_group(group, configs) do
|
||||||
Enum.reject(configs[group], fn {key, _v} ->
|
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)
|
(group == :phoenix and key == :serve_endpoints)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue