This commit is contained in:
byte[] 2020-05-22 11:53:49 -04:00
parent 243e13613d
commit 60d75a9a4f
2 changed files with 20 additions and 4 deletions

View file

@ -11,6 +11,9 @@ defmodule Philomena.Application do
# Connect to cluster nodes
{Cluster.Supervisor, [[philomena: [strategy: Cluster.Strategy.ErlangHosts]]]},
# Session storage
Philomena.MnesiaClusterSupervisor,
# Start the Ecto repository
Philomena.Repo,
@ -22,10 +25,6 @@ defmodule Philomena.Application do
Philomena.Servers.PiczelChannelUpdater,
Philomena.Servers.Config,
# Session storage
{Pow.Store.Backend.MnesiaCache, extra_db_nodes: Node.list()},
Pow.Store.Backend.MnesiaCache.Unsplit,
{Redix, name: :redix, host: Application.get_env(:philomena, :redis_host)},
{Phoenix.PubSub, [name: Philomena.PubSub, adapter: Phoenix.PubSub.PG2]},

View file

@ -0,0 +1,17 @@
defmodule Philomena.MnesiaClusterSupervisor do
use Supervisor
def start_link(init_arg) do
Supervisor.start_link(__MODULE__, init_arg, name: __MODULE__)
end
@impl true
def init(_init_arg) do
children = [
{Pow.Store.Backend.MnesiaCache, extra_db_nodes: Node.list()},
Pow.Store.Backend.MnesiaCache.Unsplit
]
Supervisor.init(children, strategy: :one_for_one)
end
end