Merge branch 'fix-otp-comparison' into 'develop'

Fix invalid string comparison for OTP versions and replace with config

See merge request pleroma/pleroma!4013
This commit is contained in:
feld 2023-12-20 23:26:59 +00:00
commit 344c798b4c
3 changed files with 14 additions and 9 deletions

View file

View file

@ -153,6 +153,15 @@
config :pleroma, Pleroma.ScheduledActivity, config_impl: Pleroma.UnstubbedConfigMock config :pleroma, Pleroma.ScheduledActivity, config_impl: Pleroma.UnstubbedConfigMock
config :pleroma, Pleroma.Web.RichMedia.Helpers, config_impl: Pleroma.StaticStubbedConfigMock config :pleroma, Pleroma.Web.RichMedia.Helpers, config_impl: Pleroma.StaticStubbedConfigMock
peer_module =
if String.to_integer(System.otp_release()) >= 25 do
:peer
else
:slave
end
config :pleroma, Pleroma.Cluster, peer_module: peer_module
if File.exists?("./config/test.secret.exs") do if File.exists?("./config/test.secret.exs") do
import_config "test.secret.exs" import_config "test.secret.exs"
else else

View file

@ -223,17 +223,13 @@ defp node_name(node_host) do
|> String.to_atom() |> String.to_atom()
end end
if System.otp_release() >= "25" do
@peer :peer
else
@peer :slave
end
defp do_start_slave(%{host: host, name: name, args: args} = opts) do defp do_start_slave(%{host: host, name: name, args: args} = opts) do
if System.otp_release() >= "25" do peer_module = Application.get_env(__MODULE__, :peer_module)
@peer.start(opts)
if peer_module == :peer do
peer_module.start(opts)
else else
@peer.start(host, name, args) peer_module.start(host, name, args)
end end
end end
end end