Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F51236
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
View Options
diff --git a/lib/irc/nola_irc.ex b/lib/irc/nola_irc.ex
index 7e23f50..4ed94d1 100644
--- a/lib/irc/nola_irc.ex
+++ b/lib/irc/nola_irc.ex
@@ -1,33 +1,25 @@
defmodule Nola.IRC do
require Logger
def env(), do: Nola.env(:irc)
def env(key, default \\ nil), do: Keyword.get(env(), key, default)
def application_childs do
import Supervisor.Spec
IRC.Connection.setup()
- Nola.Plugins.setup()
[
worker(Registry, [[keys: :duplicate, name: IRC.ConnectionPubSub]], id: :registr_irc_conn),
- worker(Nola.Membership, []),
- worker(Nola.Account, []),
- worker(IRC.UserTrack.Storage, []),
- worker(Nola.Plugins.Account, []),
- supervisor(Nola.Plugins.Supervisor, [], [name: Nola.Plugins.Supervisor]),
supervisor(IRC.Connection.Supervisor, [], [name: IRC.Connection.Supervisor]),
supervisor(IRC.PuppetConnection.Supervisor, [], [name: IRC.PuppetConnection.Supervisor]),
]
end
# Start plugins first to let them get on connection events.
def after_start() do
- Logger.info("Starting plugins")
- Nola.Plugins.start_all()
Logger.info("Starting connections")
IRC.Connection.start_all()
end
end
diff --git a/lib/nola/application.ex b/lib/nola/application.ex
index 53ca439..fa880ea 100644
--- a/lib/nola/application.ex
+++ b/lib/nola/application.ex
@@ -1,47 +1,57 @@
defmodule Nola.Application do
use Application
def start(_type, _args) do
import Supervisor.Spec
Logger.add_backend(Sentry.LoggerBackend)
+
+ Nola.Plugins.setup()
+
:ok = Nola.Matrix.setup()
:ok = Nola.TelegramRoom.setup()
# Define workers and child supervisors to be supervised
children = [
supervisor(NolaWeb.Endpoint, []),
worker(Registry, [[keys: :duplicate, name: Nola.BroadcastRegistry]], id: :registry_broadcast),
worker(Nola.IcecastAgent, []),
worker(Nola.Token, []),
worker(Nola.AuthToken, []),
Nola.Subnet,
{GenMagic.Pool, [name: Nola.GenMagic, pool_size: 2]},
worker(Registry, [[keys: :duplicate, name: Nola.PubSub]], id: :registry_nola_pubsub),
+ worker(Nola.Membership, []),
+ worker(Nola.Account, []),
+ worker(Nola.UserTrack.Storage, []),
+ worker(Nola.Plugins.Account, []),
+ supervisor(Nola.Plugins.Supervisor, [], [name: Nola.Plugins.Supervisor]),
] ++ Nola.IRC.application_childs
++ Nola.Matrix.application_childs
opts = [strategy: :one_for_one, name: Nola.Supervisor]
sup = Supervisor.start_link(children, opts)
+
start_telegram()
+ Nola.Plugins.start_all()
spawn_link(fn() -> Nola.IRC.after_start() end)
spawn_link(fn() -> Nola.Matrix.after_start() end)
spawn_link(fn() -> Nola.TelegramRoom.after_start() end)
sup
end
def config_change(changed, _new, removed) do
NolaWeb.Endpoint.config_change(changed, removed)
:ok
end
defp start_telegram() do
token = Keyword.get(Application.get_env(:nola, :telegram, []), :key)
options = [
username: Keyword.get(Application.get_env(:nola, :telegram, []), :nick, "beauttebot"),
purge: false
]
telegram = Telegram.Bot.ChatBot.Supervisor.start_link({Nola.Telegram, token, options})
end
end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Mar 14, 4:18 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33594
Default Alt Text
(3 KB)
Attached To
rNOLA Nola
Event Timeline
Log In to Comment