mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-08 09:24:18 +00:00
Prevent elixir compiler from yeeting our modules
This commit is contained in:
parent
9b362a6739
commit
ec5db753b9
|
@ -53,6 +53,7 @@ defmodule Pleroma.Application do
|
|||
Config.DeprecationWarnings.warn()
|
||||
Pleroma.Web.Plugs.HTTPSecurityPlug.warn_if_disabled()
|
||||
Pleroma.ApplicationRequirements.verify!()
|
||||
load_all_pleroma_modules()
|
||||
load_custom_modules()
|
||||
Pleroma.Docs.JSON.compile()
|
||||
limiters_setup()
|
||||
|
@ -144,6 +145,21 @@ defmodule Pleroma.Application do
|
|||
end
|
||||
end
|
||||
|
||||
def load_all_pleroma_modules do
|
||||
:code.all_available()
|
||||
|> Enum.filter(fn {mod, _, _} ->
|
||||
mod
|
||||
|> to_string()
|
||||
|> String.starts_with?("Elixir.Pleroma.")
|
||||
end)
|
||||
|> Enum.map(fn {mod, _, _} ->
|
||||
mod
|
||||
|> to_string()
|
||||
|> String.to_existing_atom()
|
||||
end)
|
||||
|> Code.ensure_all_loaded!()
|
||||
end
|
||||
|
||||
defp cachex_children do
|
||||
[
|
||||
build_cachex("used_captcha", ttl_interval: seconds_valid_interval()),
|
||||
|
|
Loading…
Reference in a new issue