diff options
author | Mark Felder <feld@feld.me> | 2023-12-20 17:49:30 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2023-12-20 23:13:33 +0000 |
commit | 928bda2e439285ef3e662290c0cc6b782909fb82 (patch) | |
tree | c0fdde75c8a64b239bd86bf8ac00f48182deaa9b /test | |
parent | 56618873af1aa08f6c271b6cd0f0cbcdfd56bcf1 (diff) | |
download | pleroma-928bda2e439285ef3e662290c0cc6b782909fb82.tar.gz pleroma-928bda2e439285ef3e662290c0cc6b782909fb82.zip |
Fix invalid string comparison for OTP versions and replace with config
Old way was wrong for multiple reasons. If we do this as a config value it fixes :slave.start/3 being picked up as a compile warning on OTP26.
Also if we want to do any real clustering we'll need something like this to support OTP25 and older.
Diffstat (limited to 'test')
-rw-r--r-- | test/support/cluster.ex | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/support/cluster.ex b/test/support/cluster.ex index 25170163f..a0ec91168 100644 --- a/test/support/cluster.ex +++ b/test/support/cluster.ex @@ -223,17 +223,13 @@ defmodule Pleroma.Cluster do |> String.to_atom() 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 - if System.otp_release() >= "25" do - @peer.start(opts) + peer_module = Application.get_env(__MODULE__, :peer_module) + + if peer_module == :peer do + peer_module.start(opts) else - @peer.start(host, name, args) + peer_module.start(host, name, args) end end end |