2018-10-11 17:37:39 +02:00
|
|
|
defmodule Mobilizon.Application do
|
2018-01-14 17:56:50 +01:00
|
|
|
@moduledoc """
|
2018-10-11 17:37:39 +02:00
|
|
|
The Mobilizon application
|
2018-01-14 17:56:50 +01:00
|
|
|
"""
|
2017-12-08 09:58:14 +01:00
|
|
|
use Application
|
|
|
|
|
|
|
|
# See https://hexdocs.pm/elixir/Application.html
|
|
|
|
# for more information on OTP Applications
|
|
|
|
def start(_type, _args) do
|
|
|
|
import Supervisor.Spec
|
|
|
|
|
|
|
|
# Define workers and child supervisors to be supervised
|
|
|
|
children = [
|
|
|
|
# Start the Ecto repository
|
2018-10-11 17:37:39 +02:00
|
|
|
supervisor(Mobilizon.Repo, []),
|
2017-12-08 09:58:14 +01:00
|
|
|
# Start the endpoint when the application starts
|
2018-10-11 17:37:39 +02:00
|
|
|
supervisor(MobilizonWeb.Endpoint, []),
|
|
|
|
# Start your own worker by calling: Mobilizon.Worker.start_link(arg1, arg2, arg3)
|
|
|
|
# worker(Mobilizon.Worker, [arg1, arg2, arg3]),
|
2018-05-17 11:32:23 +02:00
|
|
|
worker(Guardian.DB.Token.SweeperServer, []),
|
2018-10-11 17:37:39 +02:00
|
|
|
worker(Mobilizon.Service.Federator, [])
|
2017-12-08 09:58:14 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
# See https://hexdocs.pm/elixir/Supervisor.html
|
|
|
|
# for other strategies and supported options
|
2018-10-11 17:37:39 +02:00
|
|
|
opts = [strategy: :one_for_one, name: Mobilizon.Supervisor]
|
2017-12-08 09:58:14 +01:00
|
|
|
Supervisor.start_link(children, opts)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Tell Phoenix to update the endpoint configuration
|
|
|
|
# whenever the application is updated.
|
|
|
|
def config_change(changed, _new, removed) do
|
2018-10-11 17:37:39 +02:00
|
|
|
MobilizonWeb.Endpoint.config_change(changed, removed)
|
2017-12-08 09:58:14 +01:00
|
|
|
:ok
|
|
|
|
end
|
|
|
|
end
|