Backwards compatibility for OTP
This commit is contained in:
parent
3c80c86437
commit
45150848fb
@ -127,7 +127,10 @@ defmodule Pleroma.Cluster do
|
|||||||
|
|
||||||
defp start_slave({node_host, override_configs}) do
|
defp start_slave({node_host, override_configs}) do
|
||||||
log(node_host, "booting federated VM")
|
log(node_host, "booting federated VM")
|
||||||
{:ok, node} = :peer.start(%{host: "127.0.0.1", name: node_name(node_host), args: vm_args()})
|
|
||||||
|
{:ok, node} =
|
||||||
|
do_start_slave(%{host: "127.0.0.1", name: node_name(node_host), args: vm_args()})
|
||||||
|
|
||||||
add_code_paths(node)
|
add_code_paths(node)
|
||||||
load_apps_and_transfer_configuration(node, override_configs)
|
load_apps_and_transfer_configuration(node, override_configs)
|
||||||
ensure_apps_started(node)
|
ensure_apps_started(node)
|
||||||
@ -219,4 +222,18 @@ defmodule Pleroma.Cluster do
|
|||||||
|> Enum.at(0)
|
|> Enum.at(0)
|
||||||
|> 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
|
||||||
|
if System.otp_release() >= "25" do
|
||||||
|
@peer.start(opts)
|
||||||
|
else
|
||||||
|
@peer.start(host, name, args)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user