Packages

Extensible Elixir OTP Application for storing files through a unified API. Backends currently exist for the local filesystem, SFTP and the Amazon S3 API.

Current section

Files

Jump to
belt lib belt application.ex
Raw

lib/belt/application.ex

defmodule Belt.Application do
@moduledoc false
use Application
import Supervisor.Spec
@providers Belt.Config.get(:providers)
def start(_type, _args) do
children = [
supervisor(Belt.Job.Supervisor, [], []),
worker(Registry, [:unique, Belt.Job.Registry]),
worker(Belt, [], []) |
get_provider_supervisors()
]
Supervisor.start_link(children, strategy: :one_for_one, name: Belt.Supervisor)
end
defp get_provider_supervisors() do
@providers
|> Enum.map(fn(provider) ->
:"#{provider}.Supervisor"
|> supervisor([], [])
end)
end
end