Detect if Python3 is installed before launching PythonPort Genserver

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-11-08 12:14:13 +01:00
parent df21729ba0
commit ea276fbe73
4 changed files with 30 additions and 12 deletions

View File

@@ -51,7 +51,6 @@ defmodule Mobilizon do
# workers
Guardian.DB.Token.SweeperServer,
ActivityPub.Federator,
Mobilizon.PythonWorker,
TzWorld.Backend.DetsWithIndexCache,
cachex_spec(:feed, 2500, 60, 60, &Feed.create_cache/1),
cachex_spec(:ics, 2500, 60, 60, &ICalendar.create_cache/1),
@@ -73,6 +72,13 @@ defmodule Mobilizon do
] ++
task_children(@env)
children =
if Mobilizon.PythonPort.python_exists?() do
children ++ [Mobilizon.PythonWorker]
else
children
end
ErrorReporting.configure()
# Only attach the telemetry logger when we aren't in an IEx shell