Hash :
dc63c2ec
Author :
Date :
2016-04-24T14:34:18
starting migration from old version of ex_ovh to new version.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
defmodule ExOvh.Auth.Supervisor do
@moduledoc :false
use Supervisor
import ExOvh.Utils, only: [supervisor_name: 1]
alias ExOvh.Auth.Ovh.Cache, as: OvhCache
alias ExOvh.Auth.Openstack.Swift.Cache, as: SwiftCache
# Public
@doc ~S"""
Starts the OVH supervisor.
"""
def start_link(client, config, opts) do
Og.context(__ENV__, :debug)
Supervisor.start_link(__MODULE__, {client, config, opts}, [name: supervisor_name(client)])
end
# Supervisor Callbacks
def init({client, config, opts}) do
Og.context(__ENV__, :debug)
Og.log({client, config, opts}, __ENV__, :debug)
tree = [
{OvhCache,
{OvhCache, :start_link, [{client, config, opts}]}, :transient, 10_000, :worker, [OvhCache]},
# {SwiftCache,
# {SwiftCache, :start_link, [{client, config, opts}]}, :permanent, 10_000, :worker, [SwiftCache]}
]
supervise(tree, strategy: :one_for_one)
end
end