Remove Omnibot.State.cfg/0 from Omnibot.Irc module

Deprecating Omnibot.State: IRC module holds its own configuration now.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-08-11 12:48:28 -07:00
parent b423507796
commit 715480230a
2 changed files with 27 additions and 15 deletions

View File

@@ -15,16 +15,15 @@ defmodule Omnibot.Supervisor do
|> Code.eval_file()
cfg = bindings[:config]
# TODO : move cfg to its own process so reloading it is as simple as killing the process
children = [
{Task.Supervisor, name: Omnibot.RouterSupervisor, strategy: :one_for_one},
{Omnibot.State, cfg: cfg, name: Omnibot.State},
{Omnibot.PluginSupervisor, cfg: cfg, name: Omnibot.PluginSupervisor},
{Omnibot.PluginManager, cfg: cfg, name: Omnibot.PluginManager},
] ++ unless IEx.started?(),
do: [{Omnibot.Irc, name: Omnibot.Irc}],
do: [{Omnibot.Irc, cfg: cfg, name: Omnibot.Irc}],
else: []
# TODO : how to handle config reloading?
# :one_for_all here because the RouterSupervisor and IRC server are co-dependent
Supervisor.init(children, strategy: :one_for_all)
end